hana::eitherat some point (which is really just a binary
variant), but it was removed precisely for this reason.
constexprvariant, but I don’t quite understand the implementation (it seems to be based on tuple, not union, which is strange).
boost::variantaims to be a more general purpose variant from what I understand, and I don’t know whether it’s possible to make its implementation
constexpr. Are there significant differences between your variant and e.g.
variant<int, char> v = 42; variant<int, char, double> v2 = v;
hana::uniqueexample does not work with clang 4.0.0? http://melpon.org/wandbox/permlink/iMBBa9vrZWZbns2N
is_empty(set)to work; see boostorg/hana#196.
std::sethas a single element is a runtime property, while the concepts that it model is a property of the type system, which allows you to reason about your code.
The items contained in a set have no specified order so you can't technically rely on any one item being in "front". That being said you could use
Foldable. Something like:
This would fail just like
hana::front would if the
set was empty.
insertis what I did in the above link.
*are defined (see that #if 1). Do you think it is a hana bug or gcc bug? Because cang does compile this. :-)
operator*with a fully unconstrained template parameter.