This was accepted by MS Visual C++ 6.0, but is rejected in Visual Studio
..NET 2003.
I assume that this change might be because Visual Studio .NET is more C++
standard compliant than previous versions were.
Is this correct?

3 A default argument expression shall be specified only in the
parameter-­declaration­-clause of a function declaration or in
a template­-parameter (14.1). If it is specified in a parameter­-
declaration­-clause, it shall not occur within a declarator or
abstract­-declarator of a parameter­-declaration.(88)

(88) This means that default arguments cannot appear, for
example, in declarations of pointers to functions, references
to functions, or typedef declarations.
===================================================================

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!