<boost/url/grammar/lut_chars.hpp>
template<class Pred>
requires detail::is_pred<Pred>::value &&
! std::is_base_of<
lut_chars, Pred>::value
constexpr
lut_chars(Pred const& pred) noexcept;
This function constructs a character set which has as members, every value of char ch
for which the expression pred(ch)
returns true
.
struct is_digit
{
constexpr bool
operator()(char c ) const noexcept
{
return c >= '0' && c <= '9';
}
};
constexpr lut_chars digits( is_digit{} );
Linear in pred
, or constant if pred(ch)
is a constant expression.
Throws nothing.
Name | Description |
---|---|
pred | The function object to use for determining membership in the character set. |