Thread: Using a smart pointer for all objects

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    1

    Using a smart pointer for all objects

    Hi all,

    I would like to use smart pointers for all objects created on the heap. Following is where my thoughts are:

    1- Create a RootObject template class that all classes in the System must inherit from.

    2- Overload 'new' operator in RootObject to always return a smart pointer.

    Am I on the right track here? Is this even possible? If not, please advise?

    Thanks.

    phalc

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  2. Compiler "Warnings"
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 04-24-2005, 01:09 PM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. Determining the number of objects allocated to a pointer...
    By roktsyntst in forum C++ Programming
    Replies: 1
    Last Post: 04-15-2003, 06:08 PM