How does one filter duplicate types from a tuple?
For example:
using Tuple = std::tuple
usi
If you have access to Boost, then this can be done directly using boost::mp11::mp_unique.
For example:
{
using not_unique = std::tuple;
using filtered = boost::mp11::mp_unique;
static_assert(std::is_same_v, filtered>);
}
{
using already_unique = std::tuple;
using filtered = boost::mp11::mp_unique;
static_assert(std::is_same_v, filtered>);
}
Live example