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

◆ drop()

template<concepts::keyword K, concepts::option... O>
constexpr auto drop ( K const &  k,
settings< O... > const &  s 
)
related

Remove an option from a rbr::settings.

Build a rbr::settings containing all options from s except for any option bound to the k rbr::keyword.

Parameters
kKeyword to remove
sOriginal rbr::settings
Returns
An instance of rbr::settings containing all options of s except those bound to k.

Example:

#include <raberu/raberu.hpp>
#include <iostream>
int main()
{
using namespace rbr::literals;
constexpr auto aligned = "aligned"_fl;
constexpr auto transparent = "transparent"_fl;
rbr::settings v ( "surname"_kw = std::string{"john"}
, "value"_kw = 3.f
, aligned
, transparent
);
std::cout << v << "\n";
auto unaligned = drop(aligned, v);
auto unamed = drop("surname"_kw, v);
std::cout << unaligned << "\n";
std::cout << unamed << "\n";
}
constexpr auto drop(K const &k, settings< O... > const &s)
Remove an option from a rbr::settings.
Definition: drop.hpp:52
Raberu literals namespace.
Definition: keywords.hpp:369
Defines a group of options for processing.
Definition: settings.hpp:50