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>
29 decltype(Serialize(std::declval<
const T&>(),
serialize::
To<Value>{}));
31template <
typename Value,
typename T>
33 decltype(Convert(std::declval<
const Value&>(),
parse::
To<T>{}));
35template <
typename Value>
36using IsFormatValue =
typename Value::ParseException;
38template <
class Value,
class T>
39constexpr inline bool kHasParse = meta::kIsDetected<HasParse, Value, T>;
41template <
class Value,
class T>
42constexpr inline bool kHasSerialize = meta::kIsDetected<HasSerialize, Value, T>;
44template <
class Value,
class T>
45constexpr inline bool kHasConvert = meta::kIsDetected<HasConvert, Value, T>;
61template <
typename Value,
typename T>
62using ParseType =
decltype(Parse(std::declval<Value>(),
parse::
To<T>()));