Original Post
Hey all,
Are there any well-known methods for casting between smart pointers of different types? e.g.:
) remains the same, whether dealing with new/delete allocated memory or COM pointers - only the RefCounter used by the QuillPtr ever needs to be reimplemented).
Does anyone have any ideas? I''ll provide more source code as needed
Tom
class A
{
};
class B : public A
{
}
// exactly how you''d declare a smart pointer in my engine:
#define QUILL_DYNAMIC_PTR( x ) Quill::QuillPtr >
QUILL_DYNAMIC_PTR( A ) PtrToA = new A;
QUILL_DYNAMIC_PTR( B ) PtrToB = new B;
// this is impossible, due to C++ type technicalities
QUILL_DYNAMIC_PTR( A ) CastedB = PtrToB;
So far as I can understand, the only way to do such a thing would be to reimplement my smart pointer class to deal with such cases (at the moment my smart pointer class (QuillPtr