...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 a string during conversions.
Defined in header <boost/json/conversion.hpp>
template< class T> struct is_string_like;
Provides the member constant value
that is equal to true
, if T
is convertible to string_view
. 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 strings. For example:
namespace boost { namespace json { template <> struct is_string_like<your::string> : std::false_type { }; } // namespace boost } // namespace json
string
,
string_view
,
std::string
,
std::string_view
.
Convenience header <boost/json.hpp>