I want to remove duplicates from a constexpr std::array
at compile time.
Basically, I'm trying to implement a consteval
function, which returns a copy of the original array without duplicates:
consteval auto unique(std::array<...>) -> std::array<...>
I know std::sort
is constexpr, so I thought I could first sort it first, with the intention of using std::unique
next, but then I can't quite figure out how to make that work, there might be a better way than that.