how i covariant relapse forms intelligent pointers?
i have formula this:
class retinterface {...}
class ret1: open retinterface {...}
class ainterface
{
public:
practical boost::shared_ptr<retinterface> get_r() const = 0;
...
};
class a1: open ainterface
{
public:
boost::shared_ptr<ret1> get_r() const {...}
...
};
this formula does compile.
in visible studio raises
c2555: vital practical duty relapse form differs not
covariant
if i boost::shared_ptr nonetheless relapse tender pointers, formula compiles (i know due c++). i problem since boost::shared_ptr ret1 subsequent boost::shared_ptr retinterface. nonetheless i wish relapse boost::shared_ptr ret1 classes, else i contingency ban returned value after return.
- am i doing something wrong?
- if not, since libel - should extensible hoop reworking between intelligent pointers scenario? there fascinating workaround?
Comments
Post a Comment