9#include <userver/formats/parse/to.hpp>
10#include <userver/formats/serialize/to.hpp>
11#include <userver/utils/meta_light.hpp>
13USERVER_NAMESPACE_BEGIN
24template <
typename Value,
typename T>
25using HasParse =
decltype(Parse(std::declval<
const Value&>(),
parse::
To<T>{}));
27template <
typename Value,
typename T>
28using HasSerialize =
decltype(Serialize(std::declval<
const T&>(),
serialize::
To<Value>{}));
30template <
typename Value,
typename T>
31using HasConvert =
decltype(Convert(std::declval<
const Value&>(),
parse::
To<T>{}));
33template <
typename Value>
34using IsFormatValue =
typename Value::ParseException;
36template <
class Value,
class T>
37constexpr inline bool kHasParse = meta::kIsDetected<HasParse, Value, T>;
39template <
class Value,
class T>
40constexpr inline bool kHasSerialize = meta::kIsDetected<HasSerialize, Value, T>;
42template <
class Value,
class T>
43constexpr inline bool kHasConvert = meta::kIsDetected<HasConvert, Value, T>;
58template <
typename Value,
typename T>
59using ParseType =
decltype(Parse(std::declval<Value>(),
parse::
To<T>()));