...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Construct a parser from another parser, changing the Body type.
template< class OtherBody, class... Args> parser( parser< isRequest, OtherBody, Allocator >&& parser, Args&&... args);
This constructs a new parser by move constructing the header from another parser with a different body type. The constructed-from parser must not have any parsed body octets or initialized BodyReader, otherwise an exception is generated.
// Deferred body type commitment request_parser<empty_body> req0; ... request_parser<string_body> req{std::move(req0)};
If an exception is thrown, the state of the constructed-from parser is undefined.
Name |
Description |
---|---|
|
The other parser to construct from. After this call returns, the constructed-from parser may only be destroyed. |
|
Optional arguments forwarded to the message constructor. |
Type |
Thrown On |
---|---|
|
Thrown when the constructed-from parser has already initialized a body reader. |
This function participates in overload resolution only if the other parser uses a different body type.