Retrieved a value via a keyword.
{
template<
auto Keyword,
typename... Sources>
struct fetch
template<auto Keyword, typename... Sources>
using fetch_t =
typename fetch<Keyword,Sources...>::type;
}
constexpr decltype(auto) fetch(K const &k, Os const &... os)
Retrieved a value via a keyword.
Definition fetch.hpp:40
Raberu helper traits namespace.
Definition drop.hpp:61
#include <raberu/raberu.hpp>
#include <iostream>
int main()
{
int i = 77;
std::cout <<
rbr::fetch(
"size"_kw,
"size"_kw = 75ULL,
"transparent"_fl) <<
"\n";
std::cout <<
rbr::fetch(
"value"_kw | 13.37,
"size"_kw = 75ULL,
"transparent"_fl) <<
"\n";
std::cout <<
rbr::fetch(
"modal"_fl |
rbr::call([&]() {
return i++; }),
"size"_kw = 75ULL,
"transparent"_fl) <<
"\n\n";
std::cout << "i = " << i << "\n";
}
constexpr auto values(rbr::settings< Opts... > const &s)
Retrieved the list of all value stored in a settings.
Definition keys_values.hpp:88
Raberu literals namespace.
Definition keywords.hpp:368
settings(Opts const &... opts) -> settings< Opts... >
rbr::settings deduction guide
Callable object wrapper for functional default value.
Definition keywords.hpp:31