Re:More Dirty Coding Tricks from Game Developers (2010)
by StephanTLavavej on Sunday August 02, 2015 @08:00PM
(#9993034)
You're incorrect, for C89 through C++17. I'd recommend not making statements about languages you've forgotten.
In the C++ Working Paper, the Standardese is N4527 5.2.2 [expr.call]/4 "When a function is called, each parameter (8.3.5) shall be initialized (8.5, 12.8, 12.1) with its corresponding argument." followed by 8.5 [dcl.init] where /17.8 has a nice example:
"Note: An expression of type "cv1 T" can initialize an object of type "cv2 T" independently of the cv-qualifiers cv1 and cv2.
int a;
const int b = a;
int c = b;"
(A "cv-qualifier" is const or volatile; they behave similarly in many contexts, hence the collective terminology for convenience.)
In the C++ Working Paper, the Standardese is N4527 5.2.2 [expr.call]/4 "When a function is called, each parameter (8.3.5) shall be initialized (8.5, 12.8, 12.1) with its corresponding argument." followed by 8.5 [dcl.init] where /17.8 has a nice example:
"Note: An expression of type "cv1 T" can initialize an object of type "cv2 T" independently of the cv-qualifiers cv1 and cv2. int a; const int b = a; int c = b;"
(A "cv-qualifier" is const or volatile; they behave similarly in many contexts, hence the collective terminology for convenience.)