[#boost-urls-grammar-lut_chars-2constructor-02d]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::xref:boost/urls/grammar/lut_chars.adoc[lut&lowbar;chars]::lut&lowbar;chars
:relfileprefix: ../../../../
:mrdocs:

Constructor&period;

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/lut_chars.hpp#L227[boost&sol;url&sol;grammar&sol;lut&lowbar;chars&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class Pred&gt;
requires detail&colon;&colon;is&lowbar;pred&lt;Pred&gt;&colon;&colon;value &amp;&amp;
        ! std&colon;&colon;is&lowbar;base&lowbar;of&lt;
            lut&lowbar;chars, Pred&gt;&colon;&colon;value
constexpr
lut&lowbar;chars(Pred const& pred) noexcept;
----

== Description

This function constructs a character set which has as members, every value of `char ch` for which the expression `pred(ch)` returns `true`&period;

== Example

[,cpp]
----
struct is_digit
{
    constexpr bool
    operator()(char c ) const noexcept
    {
        return c >= '0' && c <= '9';
    }
};

constexpr lut_chars digits( is_digit{} );
----
== Complexity

Linear in `pred`, or constant if `pred(ch)` is a constant expression&period;

== Exception Safety

Throws nothing&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *pred*
| The function object to use for determining membership in the character set&period;
|===


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