Documentation tidying

This commit is contained in:
Vinnie Falco
2017-07-14 08:06:24 -07:00
parent c341e8415f
commit 2ea3240ed6
2 changed files with 22 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
* Documentation tidying
--------------------------------------------------------------------------------
Version 81:
* Pass string_view by value

View File

@@ -24,7 +24,17 @@ namespace beast {
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.
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
{
@@ -95,6 +105,13 @@ public:
template<class... Args>
string_param(Args const&... args);
/// Returns the contained string
string_view
str() const
{
return sv_;
}
/// Implicit conversion to @ref string_view
operator string_view const() const
{