Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
The`value_type`nested type allows the body to define the declaration of the body type as it appears in the message. This can be any type. For example, a body's value type may specify嵌套类型允许消息体定义其在消息中的声明形式,该类型可以是任意类型。例如,消息体的值类型可以指定为 `std::vector<char>`or或 `std::list<std::string>`. A custom body may even set the value type to something that is not a container for body octets, such as a [@boost:/libs/filesystem/doc/reference.html#class-path `boost::filesystem::path`]. Or, a more structured container may be chosen. This declares a body's value type as a JSON tree structure produced from a。自定义消息体甚至可以将值类型设置为非消息体字节容器类型,例如 [@boost:/libs/filesystem/doc/reference.html#class-path `boost::filesystem::path`],或者选择结构更复杂的容器。以下声明将消息体的值类型定义为由 [@boost:/doc/html/json/input_output.html#json.input_output.parsing.streaming_parser `boost::json::stream_parser`]:生成的 JSON 树结构:``` #include <boost/json/stream_parser.hpp>