forked from boostorg/beast
Documentation tidying
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
* Documentation tidying
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 81:
|
Version 81:
|
||||||
|
|
||||||
* Pass string_view by value
|
* Pass string_view by value
|
||||||
|
@@ -25,6 +25,16 @@ namespace beast {
|
|||||||
to string is made using `operator<<` to a non-dynamically
|
to string is made using `operator<<` to a non-dynamically
|
||||||
allocated static buffer if possible, else to a `std::string`
|
allocated static buffer if possible, else to a `std::string`
|
||||||
on overflow.
|
on overflow.
|
||||||
|
|
||||||
|
To use it, modify your function signature to accept
|
||||||
|
`string_param` and then extract the string inside the
|
||||||
|
function:
|
||||||
|
@code
|
||||||
|
void print(string_param s)
|
||||||
|
{
|
||||||
|
std::cout << s.str();
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
*/
|
*/
|
||||||
class string_param
|
class string_param
|
||||||
{
|
{
|
||||||
@@ -95,6 +105,13 @@ public:
|
|||||||
template<class... Args>
|
template<class... Args>
|
||||||
string_param(Args const&... args);
|
string_param(Args const&... args);
|
||||||
|
|
||||||
|
/// Returns the contained string
|
||||||
|
string_view
|
||||||
|
str() const
|
||||||
|
{
|
||||||
|
return sv_;
|
||||||
|
}
|
||||||
|
|
||||||
/// Implicit conversion to @ref string_view
|
/// Implicit conversion to @ref string_view
|
||||||
operator string_view const() const
|
operator string_view const() const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user