[#boost-urls-grammar-ref] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::ref :relfileprefix: ../../../ :mrdocs: Return a reference to a character set == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L251[boost/url/grammar/charset.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:boost/urls/grammar/CharSet.adoc[CharSet] CS> constexpr /* implementation-defined */::xref:boost/urls/grammar/implementation_defined/charset_ref.adoc[charset_ref]<CS> xref:boost/urls/grammar/ref-02.adoc[ref](CS const& cs) noexcept requires is_charset<CS>::value && ! std::is_same<CS, implementation_defined::charset_ref<CS> >::value; ---- [.small]#xref:boost/urls/grammar/ref-02.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:boost/urls/grammar/Rule.adoc[Rule] R> constexpr /* implementation-defined */::xref:boost/urls/grammar/implementation_defined/rule_ref.adoc[rule_ref]<R> xref:boost/urls/grammar/ref-0e.adoc[ref](R const& r) noexcept requires is_rule<R>::value && ! std::is_same<R, implementation_defined::rule_ref<R> >::value; ---- [.small]#xref:boost/urls/grammar/ref-0e.adoc[_» more..._]# == 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 |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#