Home Help Center

Can I use Ice's smart pointer with my own type?

Ice has a cool smart pointer implementation, with which we needn't care about memory allocation and deallocation any more. My problem is, can I use Ice's smart pointer with my own class which doesn't necessarily inherit from Ice::Object?


  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Yes, you can use IceUtil::Shared for your own types, for example:
       class Base : public virtual IceUtil::Shared
       typedef IceUtil::Handle<Base> BasePtr;

Sign In or Register to comment.