I have the following struct:
struct Feedback : public TaggedUnion<Feedback1Idx, String>
{
using TaggedUnion<Feedback1Idx, String>::TaggedUnion;
using TaggedUnion<Feedback1Idx, String>::operator=;
bool isError = false;
};
... which inherits TaggedUnion's operator =, allowing me to write the following:
Feedback a = Feedback1Idx();
Feedback b = String();
Feedback c = Feedback();
Feedback d = b;
In the examples above, I would like a.isError to be true, b.isError to be true, but c.isError to be false (and d.isError to be true because b.isError is true). In other words, anytime an inherited operator = is used, I would like .isError to be switched to true.
How can I achieve this? (without having to add a constructor/assignment operator for each template parameter I add to TaggedUnion<>)
TaggedUnion::operator=explicitly?