NP
template<typename Derived>Собсна в изначальном вопросе
struct Base
{
template<typename T>
void foo(T obj)
{
static_cast<Derived*>(this)->fooImpl(obj);
}
};
struct PolymorphicHolder
{
public:
template<typename T>
void invokeFoo(T val)
{
// ???
}
private:
struct ImplBase
{
// ???
virtual ~ImplBase() = default;
};
template<typename Derived>
struct Impl : ImplBase
{
// inherited from Base<Derived>
Derived obj;
};
ImplBase* impl_;
};
AbstractInterface
== ImplBase
, passThrough
== invokeFoo