ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
find
which returns an optional
hence the weird error
my::not_found
std::visit
hana::overload_linearly
and give a lambda that takes a my::not_found
as its parameter and then a generic lambda that handles the compile-time string
mp_rename
shuffles the types from the variant to a hana::tuple, but I think I still need to wrap them in a hana::type_c. Which I struggling to do. This is easy to do for boost::variant but there isn't matching support for std::variant that I can see
hana::experimental::types
does the same thing without wrapping individuals types in type
as that tends to create a lot of unnecessary type instantiations. If all you are doing is type computations then you don't want to use hana::tuple
either as that has several member templates that are expensive to instantiate (relatively).
mp_transform<hana::type, mp_rename<Var, hana::tuple>>>
Some time ago I tried partially applying std::visit
to a visitor in the form of a boost::hana::overload
. Clearly std::visit
can't be partially applied as it is, because it is a template function, so I first wrapped it in a lambda, like this:
auto visit = [](auto const& visitor_, auto const&... visited_){
return std::visit(visitor_, visited_...);
};
and then tried naively with the following
auto visitor = boost::hana::overload(/* list overloads here */);
auto visitWithVisitor = boost::hana::partial(visit, visitor);
which doesn't work. (After some months) I've investigated a bit and come up with an answer to why this happens: overload_t
's templated constructor is a better match than the implicitly defined copy constructor when copying a non-const
lvalue.
The problem shown above is solved by making visitor
const
, or by std::move
ing it (or more simply by passing it as an rvalue at partial
's call site), which is probably just fine anyway.
But still, what about adding overload_t(overload_t cons&)
and overload_t(overload_t&)
so that the above works?