description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Error C2255 |
Compiler Error C2255 |
11/04/2016 |
|
|
67dc4cb0-de6b-4405-bd64-d47736367a93 |
'element' : not allowed outside of a class definition
For example, a nonmember function is declared a friend
.
The following sample generates C2255:
// C2255.cpp
// compile with: /c
class A {
private:
void func1();
friend void func2();
};
friend void func1() {} // C2255
void func2(){}