Export (0) Print
Expand All
Expand Minimize

Compiler Error C2881

Error Message

'namespace1' : is already used as an alias for 'namespace2'

You cannot use the same name as an alias for two namespaces.

The following sample generates C2881:

// C2881.cpp
// compile with: /c
namespace A {
   int k;
}

namespace B {
   int i;
}

namespace C = A;
namespace C = B;   // C2881 C is already an alias for A

Community Additions

ADD
Show:
© 2014 Microsoft