Friday, July 31, 2009

Polymorphic on Smar Pointer

Polymorphic on smart pointer is allow.

Staff : class Human

shared_ptr(human) sph;
shared_ptr(staff) sps;

list(shared_ptr(human) ) cont;

cont.push(sph); -> OK
cont.push(sps); -> OK


No comments: