#include <bits/stdc++.h>
using namespace std;
class A {
int x;
public:
class B {
public:
int y;
B(int _y) : y(_y) {}
explicit operator A() const {
return A(y);
}
};
explicit A (int _x) : x(_x) {}
explicit A (const A& o) : x(o.x) {}
};
typedef unsigned int size_type;
int main () {
return 0;
}
Error: g++ -Wall -I./ -I/home/abdelrahman/main-repo/ -o "testt" "testt.cpp" (in directory: /home/abdelrahman/Desktop)
testt.cpp: In member function ‘A::B::operator A() const’: testt.cpp:11:14: error: no matching function for call to ‘A::A(A)’ return A(y); ^
Compilation failed.