Thread: iterator for deque

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    iterator for deque

    Hello everyone,


    As mentioned in Gotw about deque. What means "streamlined version of deque with simplified iterators"? I did some search and can not find out.

    http://www.gotw.ca/gotw/054.htm

    --------------------
    Finally, note that the popular library implementation that I tested has since been revised and now includes a streamlined version of deque with simplified iterators. I do not yet have a copy of that library, but it will be interesting to see how much of the deque disadvantage in even the raw iterator "traverse" and element-accessing "at" tests will remain compared to vector.
    --------------------


    thanks in advance,
    George

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It means that the implementors of the standard library the Guru tested have found a neat trick to make deque be faster. No, they're probably not going to tell you how it works, and no, it is really no concern of you, the client programmer, except that your programs will magically speed up.

    That's the nice thing about black-box interfaces.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Hi CornedBee,


    1. Speed up for what reasons? Random access elements in deque or?

    2. Do you have any experiences of using such library implementation? What is the general idea?

    Quote Originally Posted by CornedBee View Post
    It means that the implementors of the standard library the Guru tested have found a neat trick to make deque be faster. No, they're probably not going to tell you how it works, and no, it is really no concern of you, the client programmer, except that your programs will magically speed up.

    That's the nice thing about black-box interfaces.

    regards,
    George

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    1) How would I know? The implementation is better.
    2) It's better.


    Honestly, stop worrying so much about these details, and worry more about learning the base language features.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks CornedBee,


    I ask this because I know you are an expert and I am wondering whether I can learn some new ideas to improve my current work. :-)

    It is my misunderstanding that I think it is well known how the new methods of implementation of new streamlined iterator, so I ask here.

    Quote Originally Posted by CornedBee View Post
    1) How would I know? The implementation is better.
    2) It's better.


    Honestly, stop worrying so much about these details, and worry more about learning the base language features.

    regards,
    George

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    I don't think you can really learn ideas from this stuff. Yes, it's probably quite interesting in a "hey, that's clever" way, but I have my doubts about its general applicability. And to benefit from the improvement, all you have to do is use deque.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks CornedBee,


    Quote Originally Posted by CornedBee View Post
    I don't think you can really learn ideas from this stuff. Yes, it's probably quite interesting in a "hey, that's clever" way, but I have my doubts about its general applicability. And to benefit from the improvement, all you have to do is use deque.

    regards,
    George

Popular pages Recent additions subscribe to a feed