I have seen a CRTP solution, which extracted the interface into the base class, and friended only one of the pack arguments per base class. Then the most derived class inherited all the friended base classes and implemented the interface.
I cannot use this approach, since I need to protect the assignment operator, which is not inherited.
Also, since the assignment operator has a defined signature with exactly one parameter, I cannot use a key pattern.
This is what I would like to have:
template <typename... F>
struct A {
protected:
A& operator=(const SomeClass &other) {
//...
}
private:
//I would like to do the following, but it does not work
friend F...;
}
Is there a way to do what I am needing?