Archived

This forum has been archived. Please start a new discussion on GitHub.

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?

Comments

  • benoit
    benoit Rennes, France
    Yes, you can use IceUtil::Shared for your own types, for example:
       class Base : public virtual IceUtil::Shared
       {
       };
       typedef IceUtil::Handle<Base> BasePtr;
    

    Benoit.