raberu v1.1.0
Fancy Named Parameter Library
 
Loading...
Searching...
No Matches
rbr::is_equivalent< S1, S2 > Struct Template Reference

Checks the equivalence of two rbr::settings. More...

#include <raberu/impl/algo/is_equivalent.hpp>

Detailed Description

template<concepts::settings S1, concepts::settings S2>
struct rbr::is_equivalent< S1, S2 >

Checks the equivalence of two rbr::settings.

Two rbr::settings are equivalent if they contain the same exact set of keywords irregardless of their values or value types.

Template Parameters
S1rbr::settings to compare
S2rbr::settings to compare

Helper Value

namespace rbr
{
template<concepts::settings S1, concepts::settings S2>
inline constexpr bool is_equivalent_v = is_equivalent<S1,S2>::value;
}
Main Raberu namespace.
Definition: drop.hpp:11
Checks the equivalence of two rbr::settings.
Definition: is_equivalent.hpp:47

Contains the result of a call to rbr::is_equivalent.

Example:

#include <raberu/raberu.hpp>
#include <iostream>
int main()
{
using namespace rbr::literals;
auto s1 = rbr::settings("opt1"_kw = 3, "opt2"_kw = 22, "yes"_fl);
auto s2 = rbr::settings("opt1"_kw = 7.8, "yes"_fl, "opt2"_kw = 789.987);
auto s3 = rbr::settings("opt1"_kw = 7.8, "yes"_fl, "opt3"_kw = 789.987);
std::cout << std::boolalpha << rbr::is_equivalent_v<decltype(s2), decltype(s3)> << "\n";
std::cout << std::boolalpha << rbr::is_equivalent_v<decltype(s3), decltype(s2)> << "\n";
std::cout << std::boolalpha << rbr::is_equivalent_v<decltype(s2), decltype(s1)> << "\n";
std::cout << std::boolalpha << rbr::is_equivalent_v<decltype(s1), decltype(s2)> << "\n";
std::cout << std::boolalpha << rbr::is_equivalent_v<decltype(s1), decltype(s1)> << "\n";
std::cout << std::boolalpha << rbr::is_equivalent_v<decltype(s2), decltype(s2)> << "\n";
}
Raberu literals namespace.
Definition: keywords.hpp:369
Defines a group of options for processing.
Definition: settings.hpp:50