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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:49:52+00:00 2026-06-08T17:49:52+00:00

Is it mandatory to store std::shared_ptr ‘s in boost::circular_buffer ? If I’ve a boost::circular_buffer<T*>

  • 0

Is it mandatory to store std::shared_ptr‘s in boost::circular_buffer ? If I’ve a boost::circular_buffer<T*> does the circular queue deletes the element that is automatically popped by itself after n+1th insertion ?

If not then how would I delete the popped elements and manage memory leaks ?

  • 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-06-08T17:49:55+00:00Added an answer on June 8, 2026 at 5:49 pm

    Of course it’s not mandatory to store shared_ptrs, you can store lots of different types, e.g. something as simple as int

    If you store pointers the container doesn’t know they point to objects on the heap, so it doesn’t delete them when overwriting existing elements with new elements, it can’t know that it would be safe to delete a pointer. The pointer is just overwritten with a new value. If that was the last pointer to an object on the heap you have a memory leak. This is pretty clearly documented less than a quarter of the way down the page. Maybe you should read the documentation.

    If you store pointers to heap objects and you have no other way to manage them then yes, storing shared_ptr<T> is sensible (but not mandatory).

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

Sidebar

Related Questions

It seems that one, in my opinion mandatory method is missing from TValue; TValue.Equals(TValue).
I've written a regular expression that automatically detects URLs in free text that users
Is this now a mandatory requirement before uploading to the app-store? As I understand
I have written some VSTO (2003) code that sucessfully applies some mandatory subject line
Do you know any tool that support the followings: eclipse integration (not mandatory) merge
I'm designing database and I'm curious about does mandatory checkbox in mysql workbench mean,
is there a standard best practice to show that a form field is mandatory:
ODI is mandatory at work but any changes made to SQL are stored internally
Is it mandatory in some countries to make all websites accessible? If so, what
Is it absolutely mandatory for the primary key of a Hibernate model (entity) to

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.