[#boost-urls-grammar-range]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::range
:relfileprefix: ../../../
:mrdocs:

A forward range of parsed elements

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/range_rule.hpp#L62[boost&sol;url&sol;grammar&sol;range&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
class range;
----

== Types

[cols=2]
|===
| Name
| Description
| xref:boost/urls/grammar/range/iterator.adoc[`iterator`] 
| A constant, forward iterator to elements of the range
| xref:boost/urls/grammar/range/const_iterator.adoc[`const&lowbar;iterator`] 
| A constant, forward iterator to elements of the range
| xref:boost/urls/grammar/range/const_reference.adoc[`const&lowbar;reference`] 
| The type of each element of the range
| xref:boost/urls/grammar/range/difference_type.adoc[`difference&lowbar;type`] 
| The type used to represent signed integers
| xref:boost/urls/grammar/range/pointer.adoc[`pointer`] 
| Provided for compatibility, unused
| xref:boost/urls/grammar/range/reference.adoc[`reference`] 
| The type of each element of the range
| xref:boost/urls/grammar/range/size_type.adoc[`size&lowbar;type`] 
| The type used to represent unsigned integers
| xref:boost/urls/grammar/range/value_type.adoc[`value&lowbar;type`] 
| The type of each element of the range
|===

== Member Functions

[cols=2]
|===
| Name
| Description
| xref:boost/urls/grammar/range/2constructor-03.adoc[`range`]         [.small]#[constructor]#
| Constructor
| xref:boost/urls/grammar/range/2destructor.adoc[`&#126;range`] [.small]#[destructor]#
| Destructor
| xref:boost/urls/grammar/range/operator_assign-0f.adoc[`operator&equals;`] 
| Assignment
| xref:boost/urls/grammar/range/begin.adoc[`begin`] 
| Return an iterator to the beginning
| xref:boost/urls/grammar/range/empty.adoc[`empty`] 
| Return true if the range is empty
| xref:boost/urls/grammar/range/end.adoc[`end`] 
| Return an iterator to the end
| xref:boost/urls/grammar/range/size.adoc[`size`] 
| Return the number of elements in the range
| xref:boost/urls/grammar/range/string.adoc[`string`] 
| Return the matching part of the string
|===

== Description

Objects of this type are forward ranges returned when parsing using the xref:boost/urls/grammar/range_rule-0f.adoc[`range&lowbar;rule`]&period; Iteration is performed by re&hyphen;parsing the underlying character buffer&period; Ownership of the buffer is not transferred&semi; the caller is responsible for ensuring that the lifetime of the buffer extends until it is no longer referenced by the range&period;

The implementation may use temporary, recycled storage for type&hyphen;erasure&period; Objects of type `range` are intended to be used ephemerally&period; That is, for short durations such as within a function scope&period; If it is necessary to store the range for a long period of time or with static storage duration, it is necessary to copy the contents to an object of a different type&period;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *T*
| The value type of the range
|===

== See Also

xref:boost/urls/grammar/parse-0d.adoc[`parse`], xref:boost/urls/grammar/range_rule-0f.adoc[`range&lowbar;rule`]&period;


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