sequence_category

Conversion category for sequences.

Synopsis

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

struct sequence_category;

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,

  • 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.

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

namespace boost {
namespace json {

template <>
struct conversion_category_for<your::container>
{
    using type = sequence_category;
};

} // namespace boost
} // namespace json

Mathcing Types

Any SequenceContainer, array types.

Convenience header <boost/json.hpp>.