2
0
mirror of https://github.com/boostorg/url.git synced 2026-02-13 00:42:15 +00:00

static_url operator<<

fix #320
This commit is contained in:
alandefreitas
2022-08-03 18:57:29 -03:00
committed by Vinnie Falco
parent 3d52de5a02
commit 51d0db2565
2 changed files with 44 additions and 0 deletions

View File

@@ -190,8 +190,38 @@ public:
{
construct(s);
}
// hidden friend
friend
std::ostream&
operator<<(std::ostream& os, static_url const& u)
{
return os << u.string();
}
};
/** Format the static URL to the output stream
This function serializes the encoded URL
to the output stream.
@par Example
@code
static_url u( "http://www.example.com/index.htm" );
std::cout << u << std::endl;
@endcode
@return A reference to the output stream, for chaining
@param os The output stream to write to.
@param u The URL to write.
*/
template <std::size_t Capacity>
std::ostream&
operator<<(std::ostream& os, static_url<Capacity> const& u);
} // urls
} // boost