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

  • Home
  • SEARCH
  • 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 948279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:13:06+00:00 2026-05-15T23:13:06+00:00

In my project I use the std::queue class. I would like to know what

  • 0

In my project I use the std::queue class. I would like to know what happen if I do the following.

  • Get a a pointer of a element inside the queue (note: a pointer and not a iterator).
  • I make modification in the queue like push and pop in the queue (pop element which is not the pointed by the previous pointer)

Does my pointer still point on the same element I specify in the beginning ? Is it defined by the queue specification?

  • 1 1 Answer
  • 6 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-15T23:13:07+00:00Added an answer on May 15, 2026 at 11:13 pm

    std::queue uses a sequence container for its implementation. By default, std::deque is used. With a std::deque, so long as all the insertions and erasures are at the beginning or the end of the container, references and pointers to elements in the container are not invalidated.

    However, I don’t know how you are going to get a pointer to an element in the queue; it doesn’t provide functionality for that (you can only get a reference to the first and last elements in the queue).

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

Sidebar

Related Questions

I have a project which I would like to make more use of smart
In attempting to use std::select1st from <functional> in a VS2008 project I found that
In our project we use Zend Framework Model generator, which produces something like this
In a project i use the following code to open a window: window.open(href, 'mysite'
At my project I use Spring Security and GWT with url-like internationalization (http://....html?locale=en). Login
Currently, I am implementing a multi-thread project using std::thread in C++11. I use std::condition_variable
I try to use a static library in my MFC project but I get
In an Xcode project, if I use std::cout to write to the console the
I'm optimizing some instrumentation for my project (Linux,ICC,pthreads), and would like some feedback on
I use shared_ptr with constructing an object like this: std::tr1::shared_ptr<RawClusterBase> rawCluster(new RawClusterBase()); // ...

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.