Re: RefPtr and inheritance


> Glib::RefPtr refB = Glib::RefPtr(new B());
> Glib::RefPtr  refA = Glib::RefPtr (refB);


If the foregoing actually appears in your code, I wonder how it
successfully compiles since you didn't define a template for

It should be written:

Glib::RefPtr<B> refB = B::create();
Glib::RefPtr<A> refA = refB;

The foregoing assumes that class B has a create function.

Bob Caryl

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]