I am trying to implement a class that takes a number of events and then returns the first event that becomes active.
The class is something like
template <typename ...Event>
class OneOf {
public:
OneOf(Event... events);
std::variant<Event...> getReturn();
private:
std::tuple<Event...> m_events;
};
The problem is that the template may take duplicates of the same type for the event but the std::variant
will only accept unique event types.
How do I define the std::variant
in such a way so that all duplicate types from my parameter pack are eliminated?