Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3979658
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:11:48+00:00 2026-05-20T05:11:48+00:00

I love this book, sadly it does not cover smart pointers as they were

  • 0

I love this book, sadly it does not cover smart pointers as they were not part of the standard back then. So when reading the book can I fairly substitute every mentioned pointer by a smart pointer, respectively reference?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:11:49+00:00Added an answer on May 20, 2026 at 5:11 am

    Well, there are different kinds of smart pointers. For example:

    You could create a scoped_ptr class, which would be useful when you’re allocating for a task within a block of code, and you want the resource to be freed automatically when it runs of of scope.

    Something like:

    template <typename T>
    class scoped_ptr
    {
     public:
        scoped_ptr(T* p = 0) : mPtr(p) {}
        ~scoped_ptr() { delete mPtr; }
     //...
    };
    

    Additionally you could create a shared_ptr who acts the same but keeps a ref count. Once the ref count reach 0 you deallocate.

    shared_ptr would be useful for pointers stored in STL containers and the like.

    So yes, you could use smart pointers for most of the purposes of your program.
    But think judiciously about what kind of smart pointer you need and why.

    Do not simply “find and replace” all the pointers you come across.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This screen was taken from the Aldiko E book reader. I really love the
I'd really love this to work in IE. I'm not able to change the
I love this shortcut in borne shell, and want to find out if it
I love this widget in google closure, Zippy and I need an equevalent in
Whilst I'd love to solve this problem in python, I'm stuck in Delphi for
I love auto-implemented properties in C# but lately there's been this elephant standing in
I'd really love your help with this deciding whether the language of all words
On this test page: http:// www.onebagoneearth.com/ Products-test , where it says oboe love series,
So i have this ArrayList: list.get(0) == love list.get(1) == foo list.get(2) == make
I would love to get some tips from other people that have had this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.