[#boost-urls-grammar-CharSet] = xref:boost/urls/grammar/CharSet.adoc[boost::urls::grammar::CharSet] :relfileprefix: ../../../ :mrdocs: Concept for a CharSet == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/charset.hpp#L114[boost/url/grammar/charset.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class T> concept CharSet = requires (T const t, char c) { { t(c) } ‐> std::convertible_to<bool>; }; ---- == Description A `CharSet` is a unary predicate which is invocable with this equivalent signature: [,cpp] ---- bool( char ch ) const noexcept; ---- The predicate returns `true` if `ch` is a member of the set, or `false` otherwise. == Exemplar For best results, it is suggested that all constructors and member functions for character sets be marked `constexpr`. [,cpp] ---- struct CharSet { bool operator()( char c ) const noexcept; // These are both optional. If either or both are left // unspecified, a default implementation will be used. // char const* find_if( char const* first, char const* last ) const noexcept; char const* find_if_not( char const* first, char const* last ) const noexcept; }; ---- == Models * `alnum_chars` * `alpha_chars` * `digit_chars` * `hexdig_chars` * `lut_chars` == See Also xref:boost/urls/grammar/is_charset.adoc[`is_charset`], xref:boost/urls/grammar/find_if.adoc[`find_if`], xref:boost/urls/grammar/find_if_not.adoc[`find_if_not`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#