raberu v1.1.0
Fancy Named Parameter Library
 
Loading...
Searching...
No Matches
rbr::typed_keyword< ID, Type > Struct Template Reference

Typed keyword. More...

#include <raberu/impl/keywords.hpp>

Detailed Description

template<typename ID, typename Type>
struct rbr::typed_keyword< ID, Type >

Typed keyword.

A Typed keyword is a keyword that verify if a value's type is exactly matching a type.

Template Parameters
IDUnique identifier for the keyword
TypeType to accept

Public Types

using tag_type = typed_keyword< ID, 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| (call< Func > &&v) const noexcept
 Specify a Callable object as a default value for the keyword.
 
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.
 

Related Functions

(Note that these are not member functions.)

template<typename Type , typename ID >
constexpr typed_keyword< ID, Type > keyword (ID id) noexcept
 Create a typed Keyword for reuse.