raberu v1.1.0
Fancy Named Parameter Library
 
Loading...
Searching...
No Matches
rbr::settings< Opts > Struct Template Reference

Defines a group of options for processing. More...

#include <raberu/impl/settings.hpp>

Detailed Description

template<concepts::option... Opts>
struct rbr::settings< Opts >

Defines a group of options for processing.

rbr::settings acts as an aggregation of Options (ie pair of Keyword/value) that provides an user-interface for accessing or managing said Options and to gather informations.

Template Parameters
OptsList of options aggregated

Public Member Functions

constexpr settings (Opts const &... opts)
 Constructor from a variadic pack of rbr::concepts::option.
 
template<concepts::keyword Key, typename Value >
constexpr auto operator[] (_::type_or_< Key, Value > const &tgt) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Keyword >
constexpr auto operator[] (flag_keyword< Keyword > const &) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<concepts::keyword Key>
constexpr auto operator[] (Key const &k) const noexcept
 Retrieved a value via a keyword.
 

Static Public Member Functions

template<concepts::keyword Key>
static constexpr auto contains (Key const &kw) noexcept
 Checks if a given rbr::keyword is stored inside rbr::settings.
 
template<concepts::keyword... Keys>
static constexpr auto contains_any (Keys... ks) noexcept
 Checks if rbr::settings contains at least one of maybe keyword.
 
template<concepts::keyword... Keys>
static constexpr auto contains_none (Keys... ks) noexcept
 Checks if rbr::settings contains no options based on any of the selected keywords.
 
template<concepts::keyword... Keys>
static constexpr auto contains_only (Keys const &... ks) noexcept
 Checks if rbr::settings contains options based only on selected keywords.
 
static constexpr std::ptrdiff_t size () noexcept
 Number of options in current rbr::settings.
 

Related Functions

(Note that these are not member functions.)

template<concepts::keyword K, concepts::option... O>
constexpr auto drop (K const &k, settings< O... > const &s)
 Remove an option from a rbr::settings.
 
template<concepts::option... K1s, concepts::option... K2s>
constexpr auto merge (settings< K1s... > const &opts, settings< K2s... > const &defs) noexcept
 Merge two instances of rbr::settings.
 
std::ostream & operator<< (std::ostream &os, settings const &s)
 Output stream insertion.