
8 Jun
2006
8 Jun
'06
9:46 a.m.
Gottlob Frege wrote:
IIRC, one of boost's smart ptrs can be used with an incomplete type. How is the compile of the destructor delayed?
ie
~my_smart_ptr() { get()->~T(); // error: T is an incomplete type }
In pseudocode, something along the lines of: class my_smart_ptr { T * p; void (*f)( T* ); my_smart_ptr( T* p ): p( p ), f( &delete ) {} ~my_smart_ptr() { f(p); } };
I wondered through lots of the shared_ptr code, but I got a bit bleary-eyed. On that note, does anyone have a script or preprocessor call or something that converts all the boost code into the 'clean and ideal boost'? ie the one without the layers and layers of compiler workarounds, etc?
shared_ptr doesn't have _that_ many compiler workarounds. :-)