sequence_category

Conversion category for sequences.

Synopsis

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

using sequence_category = std::integral_constant< conversion_category, conversion_category::sequence >;

Description

Sequences are represented in JSON as arrays.

By default a type T is considered a sequence if

  • given t, a glvalue of type T; and

  • given It, the type denoted by decltype(std::begin(t)), std::iterator_traits<It>::iterator_category is well-formed and denotes a type; and

  • decltype(std::end(t)) also denotes the type It; and

  • std::iterator_traits<It>::value_type is not T; and

  • std::iterator_traits<It>::value_type is not T.

Users can specialize conversion_category_of for their own types if they want them to be treated like sequences. For example:

namespace boost { namespace json {

template <>
struct conversion_category_of<your::container> : sequence_category
{ };

} }

Matching Types

Any SequenceContainer, array types.

Convenience header <boost/json.hpp>.