Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > variable initialization order

Reply
Thread Tools

variable initialization order

 
 
brickanna brickanna is offline
Junior Member
Join Date: Aug 2008
Posts: 1
 
      08-20-2008
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; ?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Static member variable initialization order aakash C++ 2 04-23-2011 06:13 PM
global variable vs static member initialization order n.torrey.pines@gmail.com C++ 10 03-15-2007 02:21 PM
Initialization of non-integral type in initialization list anongroupaccount@googlemail.com C++ 6 12-11-2005 09:51 PM
Initialization via ctor vs. initialization via assignment Matthias Kaeppler C++ 2 07-18-2005 04:25 PM
Default Initialization Vs. Value Initialization JKop C++ 10 09-22-2004 07:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57