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.




  1. am i doing something wrong?

  2. if not, since libel - should extensible hoop reworking between intelligent pointers scenario? there fascinating workaround?



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?