View Single Post
  #2   Spotlight this post!  
Unread 19-10-2013, 11:56
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Same initialization as declaration in constructor, why?

I don't know of anything in the C++ standard that requires the member initialization list to be in declaration order. It might be some limitation of the compiler, or they might be encouraging that for code readability because the C++ standard does say that no matter the order in the initialization list, the class members will be initialized in the order they are declared in the class definition.

I don't have windriver installed so I can't check to be sure which it might be, but there's nothing keeping you from trying it out. What happens if you reverse the initializers in the example code and try to compile it?
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote