20 Aug
2013
20 Aug
'13
8:30 a.m.
On 19-08-2013 22:18, Larry Evans wrote:
The 1st attachment uses the offset method for the container and has the:
template<typename F> void push_back(F const&);
method.
The output is in 2nd attachment.
You work fast :-) Since the classes in a hierarchy is normally not copyable (though perhaps cloneable), I would make push_back like this: template< class T, typename... Args > void push_back( Args... args ) { // A. static assert that T* is convertiable to Base* // B. all the usual stuff // C. in-place construct from std::forward(args)... } -Thorsten