implementation of queue in c++

Discussion in 'C++' started by surrealtrauma, May 15, 2005.

  1. how can i implemete a pointer-based queue in c++?
     
    surrealtrauma, May 15, 2005
    #1
    1. Advertisements

  2. surrealtrauma

    Kai-Uwe Bux Guest

    Why would you want to: what about using std::queue?


    Best

    Kai-Uwe Bux
     
    Kai-Uwe Bux, May 15, 2005
    #2
    1. Advertisements

  3. surrealtrauma

    Rapscallion Guest

    Because std::queue is value-based (like any Standard container), not
    pointer-based?
     
    Rapscallion, May 15, 2005
    #3
  4. surrealtrauma

    Kai-Uwe Bux Guest

    I am confused, very likely, I do not understand what "pointer-based queue"
    means: what about std::queue< T* > or some std::queue< SmartPtr< T > > ?


    Best

    Kai-Uwe Bux
     
    Kai-Uwe Bux, May 15, 2005
    #4
  5. surrealtrauma

    Peter Julian Guest

    A standard container can both provide the allocation mechanism or let the
    user manage it. What makes you believe that a valid derefenced pointer is
    not a value?
     
    Peter Julian, May 15, 2005
    #5

  6. I am not sure what you mean. It is implemented by using pointers and can store variables,
    pointers or any other objects.
     
    Ioannis Vranos, May 15, 2005
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.