variable initialization order

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

  1. brickanna

    brickanna

    Joined:
    Aug 20, 2008
    Messages:
    1
    Likes Received:
    0
    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. Advertisements

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:
    1,341
  2. Matthias Kaeppler
    Replies:
    2
    Views:
    599
    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:
    712
    Ron Natalie
    Dec 11, 2005
  4. toton
    Replies:
    5
    Views:
    1,117
    Victor Bazarov
    Sep 28, 2006
  5. 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,422
    Victor Bazarov
    Mar 15, 2007
  6. Jess
    Replies:
    23
    Views:
    1,307
  7. aaragon
    Replies:
    2
    Views:
    802
    James Kanze
    Nov 2, 2008
  8. aakash
    Replies:
    2
    Views:
    347
    aakash
    Apr 23, 2011
Loading...