15#include "adapter_for.hpp"
23template <
typename T,
typename FExtract,
typename FToJson>
28 template <
typename FUExtract,
typename FUToJson>
30 _extract(std::forward<FUExtract>(
extract_)),
31 _to_json(std::forward<FUToJson>(
to_json_))
46 template <
typename FUExtract>
53 template <
typename FUExtract,
typename =
void>
60 template <
typename FUToJson>
67 template <
typename FUToJson,
typename =
void>
79template <
typename FExtract,
typename FToJson>
93template <
typename FExtract,
typename FToJson,
typename =
void>
94auto make_adapter(FExtract
extract, FToJson to_json_)
95 -> function_adapter<decltype(extract(std::declval<const value&>())),
100 return function_adapter<decltype(extract(std::declval<const value&>())),
104 (std::move(
extract), std::move(to_json_));
An adapter for the type T.
An adapter for enumeration types.
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...
Copyright (c) 2014-2020 by Travis Gockel.
T extract(const value &from, const formats &fmts)
Extract a C++ value from from using the provided fmts.
Conversion between C++ types and JSON values.