raberu v1.1.0
Fancy Named Parameter Library
Loading...
Searching...
No Matches

Checked keyword. More...

#include <raberu/impl/keywords.hpp>

Detailed Description

template<typename ID, template< class > class Checker>
struct rbr::checked_keyword< ID, Checker >

Checked keyword.

A Checked keyword is a keyword that verify if a value's type satisfies a predicates before binding it

Template Parameters
IDUnique identifier for the keyword
CheckerUnary template meta-function acting as predicate

Public Types

using tag_type
 Derived keyword type.

Public Member Functions

constexpr decltype(auto) operator() (Os &&... o) const
 Keyword fetching from options set.
constexpr auto operator<=> (as_keyword const &) const noexcept=default
 Keyword comparison.
constexpr auto operator| (Type &&v) const noexcept
 Specify a default value for the keyword.
std::ostream & show (std::ostream &os, V const &v) const
 Stream insertion function.

Static Public Member Functions

static constexpr bool accept ()
 Compile-time validation of value.

(Note that these are not member symbols.)

template<template< class > class Checker, typename ID>
constexpr checked_keyword< ID, Checker > keyword (ID id) noexcept
 Create a checked keyword for reuse.