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

◆ operator()()

constexpr decltype(auto) rbr::as_keyword< typed_keyword< ID, Type > >::operator() ( Os &&...  o) const
inlineconstexprinherited

Keyword fetching from options set.

Parameters
oSet of options to inspect
Returns
f current keyword is present in o..., return its bound value. Otherwise, returns an instance of rbr::unknown_key.

Example:

#include <raberu/raberu.hpp>
#include <iostream>
using namespace rbr::literals;
inline constexpr auto value = "value"_kw;
inline constexpr auto line = "line"_kw;
inline constexpr auto file = "file"_kw;
int main()
{
std::cout << file (value = 45.5, line = 158, file = 'x') << '\n';
std::cout << line (value = 45.5, line = 158, file = 'x') << '\n';
std::cout << value(value = 45.5, line = 158, file = 'x') << '\n';
}
Raberu literals namespace.
Definition: keywords.hpp:369