So I have something like so
class baseclass {
....
}
class derived : public baseclass {
...
}
void func(boost::shared_ptr<baseclass>& a){
//stuff
}
boost::shared_ptr<derived> foo;
func(foo);
Will this work? I assume not because its not the same type, however I do not posses the ability to cast it to the right type, so is there any work around that you can think of that will make this work?
Edit: the reason I can't do the cast to my knowledge is because I'm doing a sort on a vector of type boost::shared_ptr<derived>
so I only call sort with vec.begin() and vec.end()