You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting compiler errors when using simple_match on a std::variant
[build] /Users/alan/Git/simple_match/include/simple_match/implementation/some_none.hpp:120:73: error: no member named 'get_pointer' in 'simple_match::customization::pointer_getter<std::__1::variant<X, Y> >' [build] auto ptr = customization::pointer_getter<std::decay_t<T>>::template get_pointer<Class>(std::forward<T>(t));
Here is the code sample;
struct X { int _x; X(int x) : _x(x) {}; };
struct Y { int _y; Y(int y) : _y(y) {}; };
using XY = std::variant<X, Y>;
std::string eval(const XY& v) {
using namespace simple_match;
using namespace simple_match::placeholders;
return match(v,
some<X>(), [](auto&& x) { return "Found variant Y";},
some<Y>(), [](auto&& y) { return "Found variant X";}
);
}
void test_variant() {
XY xy{ X(2) };
const auto & eval(xy);
}
This code sample is based on the math_variant_t example in test.cpp only without the variant recursive wrapper and of course without Boost.
Could anyone please help ?
Am I using simple_match correctly ?
Many thanks in advance.
The text was updated successfully, but these errors were encountered:
I am getting compiler errors when using simple_match on a std::variant
[build] /Users/alan/Git/simple_match/include/simple_match/implementation/some_none.hpp:120:73: error: no member named 'get_pointer' in 'simple_match::customization::pointer_getter<std::__1::variant<X, Y> >' [build] auto ptr = customization::pointer_getter<std::decay_t<T>>::template get_pointer<Class>(std::forward<T>(t));
Here is the code sample;
This code sample is based on the
math_variant_t
example intest.cpp
only without the variant recursive wrapper and of course without Boost.Could anyone please help ?
Am I using
simple_match
correctly ?Many thanks in advance.
The text was updated successfully, but these errors were encountered: