Ik heb de volgende class definitie
In Vision Studio 2010 krijg ik de volgende fouten:
C++:
En deze code:1
2
3
4
5
6
7
8
9
10
11
12
13
| class A { public: class B { public: B(){} }; A( const B & ); A(); const A &operator=( const A & ); }; |
C++:
In Visual Studio 6 compileert dit zonder problemen, en de juiste constructors worden ook aangeroepen. 1
2
3
4
| A a1( A::B() ); A a2; a2 = a1; a1 = a2; |
In Vision Studio 2010 krijg ik de volgende fouten:
code:
Wat gebeurt hier?
1
2
3
4
5
6
| a2=a1; error C2679: binary '=' : no operator found which takes a right-hand operand of type 'A (__cdecl *)(A::B (__cdecl *)(void))' (or there is no acceptable conversion) could be 'const A &A::operator =(const A &)' while trying to match the argument list '(A, A (__cdecl *)(A::B (__cdecl *)(void)))' a1=a2; error C2659: '=' : function as left operand |