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



Determine if T should be treated as a described class.


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

    class T>
struct is_described_class

Described classes are serialised as objects with an element for each described public data member. A described class should not have described bases or non-public members.

Or more formally, given L, a class template of the form template<class...> struct L {};, 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 as described classes. For example:

namespace boost {
namespace json {

template <>
struct is_described_class<your::described_class> : std::false_type
{ };

} // namespace boost
} // namespace json

Users can also specialize the trait for their own types with described bases to enable this conversion implementation. In this case the class will be serialized in a flattened way, that is members of bases will be serialized as direct elements of the object, and no nested objects will be created for bases.

See Also


Convenience header <boost/json.hpp>