template<typename BinaryType>
class nlohmann::byte_container_with_subtype< BinaryType >
an internal type for a backed binary type
This type extends the template parameter BinaryType provided to basic_json
with a subtype used by BSON and MessagePack. This type exists so that the user does not have to specify a type themselves with a specific naming scheme in order to override the binary type.
- Template Parameters
-
BinaryType | container to store bytes (std::vector<std::uint8_t> by default) |
- Since
- version 3.8.0; changed type of subtypes to std::uint64_t in 3.10.0.
Definition at line 5033 of file json.hpp.
template<typename BinaryType >
clears the binary subtype
Clears the binary subtype and flags the value as not having a subtype, which has implications for serialization; for instance MessagePack will prefer the bin family over the ext family.
@complexity Constant.
@exceptionsafety No-throw guarantee: this member function never throws exceptions.
- See also
- see subtype() – return the binary subtype
-
see set_subtype() – sets the binary subtype
-
see has_subtype() – returns whether or not the binary value has a subtype
- Since
- version 3.8.0
Definition at line 5167 of file json.hpp.
template<typename BinaryType >
return the binary subtype
Returns the numerical subtype of the value if it has a subtype. If it does not have a subtype, this function will return subtype_type(-1) as a sentinel value.
- Returns
- the numerical subtype of the binary value
@complexity Constant.
@exceptionsafety No-throw guarantee: this member function never throws exceptions.
- See also
- see set_subtype() – sets the binary subtype
-
see clear_subtype() – clears the binary subtype
-
see has_subtype() – returns whether or not the binary value has a subtype
- Since
- version 3.8.0; fixed return value to properly return subtype_type(-1) as documented in version 3.10.0
Definition at line 5122 of file json.hpp.