Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 88fe07608e.


Determine if T can be treated like a 1-to-1 mapping during conversions.


Defined in header <boost/json/conversion.hpp>

    class T>
struct is_map_like

Given t, a glvalue of type T, if

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 mappings. For example:

namespace boost {
namespace json {

template <>
struct is_map_like<your::map> : std::false_type
{ };

} // namespace boost
} // namespace json

The restriction for t.emplace() return type ensures that the container does not accept duplicate keys.

Types satisfying the trait

std::map, std::unordered_map.

See Also

value_from, value_to

Convenience header <boost/json.hpp>