:relfileprefix: ../../../
[#boost-urls-grammar-ref]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/grammar.adoc[pass:[grammar]]::ref

  


Return a reference to a character set



=== Synopsis
  

[source,cpp,subs="verbatim,macros,-callouts"]
----
template<class CharSet>
constexpr
pass:q[_implementation-defined_]
xref:boost/urls/grammar/ref-0f.adoc[pass:[ref]](CharSet const& cs) noexcept;
----

[source,cpp,subs="verbatim,macros,-callouts"]
----
template<class Rule>
constexpr
pass:q[_implementation-defined_]
xref:boost/urls/grammar/ref-07.adoc[pass:[ref]](Rule const& r) noexcept;
----
  
=== Description


This function returns a character set which
references the specified object. This is
used to reduce the number of bytes of
storage (`sizeof`) required by a combinator
when it stores a copy of the object.


Ownership of the object is not transferred;
the caller is responsible for ensuring the
lifetime of the object is extended until it
is no longer referenced. For best results,
`ref` should only be used with compile-time
constants.




=== Parameters

|===
| Name | Description 

| *r*
| 
The rule to use

|===




