...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Determine if T
can be treated
like std::filesystem::path
during conversions.
Defined in header <boost/json/conversion.hpp>
template< class T> struct is_path_like;
Given t
, a glvalue of type
T
, if
It
, the type denoted
by decltype(std::begin(t))
,
std::iterator_traits<It>::iterator_category
is well-formed and
denotes a type; and
std::iterator_traits<It>::value_type
is T
;
and
T::value_type
is well-formed and denotes
a type; and
T::string_type
is well-formed, denotes
a type, and is an alias for std::basic_string< T::value_type
>
;
then the trait provides the member constant value
that is equal to true
. Otherwise,
value
is equal to false
.
Users can specialize the trait for their own types if they don't want them to be treated like filesystem paths. For example:
namespace boost { namespace json { template <> struct is_path_like<your::path> : std::false_type { }; } // namespace boost } // namespace json
std::filesystem::path
, boost::filesystem::path
.
Convenience header <boost/json.hpp>