variable initialization order

Discussion in 'C Programming' started by brickanna, Aug 20, 2008.

  1. brickanna

    brickanna

    Joined:
    Aug 20, 2008
    Messages:
    1
    Consider:

    std::map<int, int> m;
    for(std::map<int, int>::iterator a=m.begin(), b=a; ........

    Does the standard guarantee that b gets initialized after a?
    Does the answer change for an ordinary definition list such as
    int a=3, b=a; ?
     
    brickanna, Aug 20, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JKop
    Replies:
    10
    Views:
    948
  2. Matthias Kaeppler
    Replies:
    2
    Views:
    445
    Victor Bazarov
    Jul 18, 2005
  3. anongroupaccount@googlemail.com

    Initialization of non-integral type in initialization list

    anongroupaccount@googlemail.com, Dec 11, 2005, in forum: C++
    Replies:
    6
    Views:
    462
    Ron Natalie
    Dec 11, 2005
  4. n.torrey.pines@gmail.com

    global variable vs static member initialization order

    n.torrey.pines@gmail.com, Mar 15, 2007, in forum: C++
    Replies:
    10
    Views:
    1,124
    Victor Bazarov
    Mar 15, 2007
  5. aakash
    Replies:
    2
    Views:
    249
    aakash
    Apr 23, 2011
Loading...

Share This Page