Results 1 to 2 of 2

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

  1. #1
    timeguest is offline Registered User
    Join Date
    Oct 2004
    Posts
    16

    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?

  2. #2
    benoit's Avatar
    benoit is online now ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Yes, you can use IceUtil::Shared for your own types, for example:

    Code:
       class Base : public virtual IceUtil::Shared
       {
       };
       typedef IceUtil::Handle<Base> BasePtr;
    Benoit.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. smart pointer down cast
    By peterlspot in forum Help Center
    Replies: 3
    Last Post: 05-24-2008, 09:37 AM
  2. Smart Pointer for Sequences
    By kalaxy in forum Help Center
    Replies: 3
    Last Post: 02-14-2008, 07:42 PM
  3. smart pointer list crash problem!
    By netfish in forum Help Center
    Replies: 9
    Last Post: 11-17-2006, 07:24 AM
  4. About the smart pointer.
    By level in forum Help Center
    Replies: 11
    Last Post: 08-04-2004, 08:16 PM
  5. Puzzle on smart pointer
    By soloman817 in forum Help Center
    Replies: 1
    Last Post: 07-13-2004, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •