FIX: Default Constructor Argument Can Not Use Namespace Scope (167350)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q167350 SYMPTOMS
When you give the default argument value for a class constructor a value
that references a namespace via the '::' operator, a C2065 error occurs as
follows:
[FileName](12) : error C2065: 'inside' : undeclared identifier
RESOLUTION
To work around this problem, use either the using directive to instruct the
compiler to consider the namespace as a possible place to find all symbols,
or the using declaration to tell the compiler to consider the namespace for
the specific symbol that is referenced by the default argument. Please see
the workarounds noted in the sample code below. Note that these workarounds
make it unnecessary to use the '::' operator to explicitly reference the
namespace, but it is also not necessary to remove it.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was corrected in Visual C++ version 6.0 for Windows.
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | kbBug kbfix kbVC600fix KB167350 |
---|
|