[#boost-urls-url_view_base-08friend-0ff]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::operator&lt;&lt;
:relfileprefix: ../../../
:mrdocs:


Format the url to the output stream

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2600[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
friend
std::ostream&
operator&lt;&lt;(
    std::ostream& os,
    xref:boost/urls/url_view_base.adoc[url&lowbar;view&lowbar;base] const& u);
----

== Description


This function serializes the url to        the specified output stream&period; Any        percent&hyphen;escapes are emitted as&hyphen;is&semi;        no decoding is performed&period;


=== Example

[,cpp]
----
url_view u( "http://www.example.com/index.htm" );
std::stringstream ss;
ss << u;
assert( ss.str() == "http://www.example.com/index.htm" );
----

=== Effects

[,cpp]
----
return os << u.buffer();
----

=== Complexity

Linear in `u&period;buffer()&period;size()`


=== Exception Safety

Basic guarantee&period;



== Return Value


A reference to the output stream, for chaining



== Parameters


|===
| Name | Description

| *os*
| The output stream to write to&period;


| *u*
| The url to write&period;


|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
