ゴミ箱
|
#include <string_param.hpp>
Public Member Functions | |
string_param (string_param const &)=delete | |
Copy constructor (disallowed) More... | |
string_param & | operator= (string_param const &)=delete |
Copy assignment (disallowed) More... | |
template<class... Args> | |
string_param (Args const &...args) | |
string_view | str () const |
Returns the contained string. More... | |
operator string_view const () const | |
Implicit conversion to string_view. More... | |
template<class T0 , class... TN> | |
void | print_n (T0 const &t0, TN const &...tn) |
template<class T0 , class T1 , class... TN> | |
void | print (T0 const &t0, T1 const &t1, TN const &...tn) |
A function parameter which efficiently converts to string.
This is used as a function parameter type to allow callers notational convenience: objects other than strings may be passed in contexts where a string is expected. The conversion to string is made using operator<<
to a non-dynamically allocated static buffer if possible, else to a std::string
on overflow.
To use it, modify your function signature to accept string_param
and then extract the string inside the function:
|
delete |
Copy constructor (disallowed)
boost::beast::string_param::string_param | ( | Args const &... | args | ) |
Constructor
This function constructs a string as if by concatenating the result of streaming each argument in order into an output stream. It is used as a notational convenience at call sites which expect a parameter with the semantics of a string_view.
The implementation uses a small, internal static buffer to avoid memory allocations especially for the case where the list of arguments to be converted consists of a single integral type.
args | One or more arguments to convert |
|
inline |
Implicit conversion to string_view.
|
delete |
Copy assignment (disallowed)
void boost::beast::string_param::print | ( | T0 const & | t0, |
T1 const & | t1, | ||
TN const &... | tn | ||
) |
void boost::beast::string_param::print_n | ( | T0 const & | t0, |
TN const &... | tn | ||
) |
|
inline |
Returns the contained string.