Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 555 Bytes

compiler-error-c2255.md

File metadata and controls

28 lines (23 loc) · 555 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2255
Compiler Error C2255
11/04/2016
C2255
C2255
67dc4cb0-de6b-4405-bd64-d47736367a93

Compiler Error C2255

'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(){}