zoo
zoo copied to clipboard
Zoo library
moved this into a new PR for clarity. Literals can now be written like so: ```cpp static_assert(SWAR{Literals, {2, 1}}.value() == 0x00000002'00000001); static_assert(SWAR{Literals, {1, 2}}.value() == 0x00000001'00000002); static_assert(SWAR{Literals, {4, 3, 2,...
Here is the headline test of this PR. ```cpp using S = SWAR; constexpr auto base = S::fromLaneLiterals({2, 3, 5, 6}); constexpr auto exponent = S::fromLaneLiterals({7, 4, 2, 3}); constexpr...
std::optional introduces inefficiencies in the case where the space for the discriminator could be employed by the alternative. In other words, the data structure in question might already have an...
While std::priority_queue can be instantiated with unique pointers, it isn't usable in practice, because of the way the top() and pop() methods interact with each other. This forces the user...
Create a template adaptor semantically equivalent to std::variant, but in which the discriminant is user-specified instead of a "one size fits all" solution.
https://github.com/thecppzoo/zoo/blob/56a5071cebaf41992f6db5639100482644a48f41/test/inc/zoo/variant.h#L89
C++20 will have a new trait [std::remove_cvref](https://en.cppreference.com/w/cpp/types/remove_cvref) that doesn't have undesirable effect of `std::decay` on arrays, so maybe it's worth using it for example here: https://github.com/thecppzoo/zoo/blob/d59092ae807a6a8780981dcd0dfb8104ea8ba81d/inc/meta/NotBasedOn.h#L14