:relfileprefix: ../../
[#boost-urls-operator_lshift-05]

= xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::operator<<


Format the url to the output stream


== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L2778[boost/url/url_view_base.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:std.adoc[std]::ostream&
operator<<(
    xref:std.adoc[std]::ostream& os,
    xref:boost/urls/url_view_base.adoc[url_view_base] const& u);
----

== Description


This function serializes the url to
the specified output stream. Any
percent-escapes are emitted as-is;
no decoding is performed.

=== 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.buffer().size()`

=== Exception Safety

Basic guarantee.




== Return Value


A reference to the output stream, for chaining



== Parameters

|===
| Name | Description 

| *os*
| 
The output stream to write to.

| *u*
| 
The url to write.

|===




