Returning a derived class of a virtual class in C++
问题 here's my problem. I have a template abstract class RandomVariable with pure virtual function operator()() template<T> class RandomVariable<T> { public: virtual T operator()() = 0; /* other stuff */ protected: T value; } I also have a template abstract class Process with pure virtual function operator()() template<T> class Process<T> { public: typedef std::pair<double, T> state; typedef std::list<state> result_type; virtual result_type operator()() = 0; /* other stuff */ protected: result