:relfileprefix: ../../../
[#boost-urls-segments_encoded_ref-erase-00a]

= xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/segments_encoded_ref.adoc[pass:[segments_encoded_ref]]::erase


Erase segments


== Synopsis

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/segments_encoded_base/iterator.adoc[iterator]
erase(
    xref:boost/urls/segments_encoded_base/iterator.adoc[iterator] first,
    xref:boost/urls/segments_encoded_base/iterator.adoc[iterator] last) noexcept;
----

== Description


This function removes a range of segments
from the container.



All iterators that are equal to
`first` or come after are invalidated.

=== Complexity

Linear in `this-&gt;url().encoded_resource().size()`.

=== Exception Safety

Throws nothing.




== Return Value


An iterator to one past
the removed range.



== Parameters

|===
| Name | Description 

| *first,*
| 
last The range of
segments to erase.

|===




