These are chat archives for boostorg/hana
std::set<T>with a single element is a
SequenceContainer, because it happens to have a single element.
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.
hana::uniquedoes not work on clang :smile:
hana::insertis better because (I think)
uniquerequires sorted or already grouped values.
insertis what I did in the above link.