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 7566425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:24:34+00:00 2026-05-30T14:24:34+00:00

With c++11 out there, I was asking myself if there is a replacement of

  • 0

With c++11 out there, I was asking myself if there is a replacement of the boost::ptr_containers in c++11. I know I can use e.g. a std::vector<std::unique_ptr<T> >, but I’m not sure if this is a complete replacement. What is the recommended way of handling these cases?

  • 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-30T14:24:35+00:00Added an answer on May 30, 2026 at 2:24 pm

    They really solve two similar but different problems.

    A pointer container is a way to store objects in a container that just so happen to be pointers to allocated memory rather than values. They do everything in their power to hide the fact that they are a container of pointers. This means:

    • Entries in the container cannot be NULL.
    • Values you get from iterators and functions are references to the type, not pointers to the type.
    • Working with many standard algorithms can be… tricky. And by “tricky”, I mean broken. Pointer containers have their own built-in algorithms.

    However, the fact that pointer containers know that they’re containers of pointers, they can offer some new functionality:

    • A clone member function that performs a deep copy, via the use of a certain “Cloneable” concept on the type of the object.
    • The ability of a container to release ownership of its objects (after a shallow copy, for example).
    • Built-in functions to transfer ownership to other containers.

    They really are quite different concepts. There is a lot of stuff you would have to do manually that pointer containers can do automatically with specialized functions.

    If you really need a container of pointers, then you can use containers of unique_ptr. But if you need to store a bunch of objects that you happen to heap allocate, and you want to play special games with them involving ownership and such, then the pointer containers are not a bad idea.

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

Sidebar

Related Questions

How can I find out what caused equals() to return false? I'm not asking
Hey I know I been asking alot of questions.. but not much resources on
I know there is a lot of information out there about using the onItemClickListener
I know there are plenty of questions on SO asking for regex help so
I know I can use ColdFusion cache APIs to clear data as such: <cfset
Anyone out there using YAML as a data DSL in .NET? I'd like to
Hi out there in Stackland. I was wondering if there was either a function
Anyone out there who knows what are the differences between BasicRenderEngine and LazyRenderEngine?
Are there simple libraries out there (.NET and Java) that are able to validate
Are there any products out there that convert Flash SWFs to XAML (I'm interested

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.