123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #ifndef BOOST_JSON_VALUE_TO_HPP
- #define BOOST_JSON_VALUE_TO_HPP
- #include <boost/json/detail/config.hpp>
- #include <boost/json/value.hpp>
- #include <boost/json/detail/value_to.hpp>
- BOOST_JSON_NS_BEGIN
- template<class T>
- struct value_to_tag;
- #ifdef BOOST_JSON_DOCS
- template<class T>
- T
- value_to(const value& jv);
- #else
- template<class T, class U
- , class = typename std::enable_if<
- ! std::is_reference<T>::value &&
- std::is_same<U, value>::value>::type
- >
- T
- value_to(const U& jv)
- {
- return detail::value_to_impl(
- value_to_tag<typename std::remove_cv<T>::type>(), jv);
- }
- #endif
- #ifdef BOOST_JSON_DOCS
- template<class T>
- using has_value_to = __see_below__;
- #else
- template<class T, class>
- struct has_value_to
- : std::false_type { };
- template<class T>
- struct has_value_to<T, detail::void_t<decltype(
- detail::value_to_impl(
- value_to_tag<detail::remove_cvref<T>>(),
- std::declval<const value&>())),
- typename std::enable_if<
- ! std::is_reference<T>::value>::type
- > > : std::true_type { };
- #endif
- BOOST_JSON_NS_END
- #endif
|