[move] will boost::rv work with types with virtual destructor?

sorry for a dumb question i noticed boost move lib mentioned in a recent message and decided to look at it i noticed that destructor for boost::rv class is declared but not defined so it can no longer be generated automatically then if an arbitrary type has a virtual destructor and we want to parameterize the boost::rv template with it a vtable for the boost::rv<type> must be generated among other things it must hold a pointer to rv<type>::~rv which is not defined is that really a problem? -- Pavel

DE wrote:
sorry for a dumb question i noticed boost move lib mentioned in a recent message and decided to look at it i noticed that destructor for boost::rv class is declared but not defined so it can no longer be generated automatically then if an arbitrary type has a virtual destructor and we want to parameterize the boost::rv template with it a vtable for the boost::rv<type> must be generated among other things it must hold a pointer to rv<type>::~rv which is not defined is that really a problem?
-- Pavel
boost::rv<T> is never (and cannot be) instantiated. You only ever refer to references (for lack of better wording at the moment) to boost::rv<T>. It's purpose is really only to statically tag an object of type T as movable, yet still be able to access the object's member functions. So no, the lack of constructors and destructor is not a problem ;) - Jeff

on 25.02.2010 at 22:35 Jeffrey Hellrung wrote :
boost::rv<T> is never (and cannot be) instantiated. You only ever refer to references (for lack of better wording at the moment) to boost::rv<T>. It's purpose is really only to statically tag an object of type T as movable, yet still be able to access the object's member functions.
So no, the lack of constructors and destructor is not a problem ;)
thanks for explanation interesting approach -- Pavel
participants (2)
-
DE
-
Jeffrey Hellrung