Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AAA {
- public:
- AAA() {}
- AAA(const AAA&) {}
- };
- class BBB {
- public:
- BBB() {}
- operator AAA() { AAA a; return a; }
- };
- int main() {
- BBB b;
- AAA a = {b};
- }
- class AAA {};
- class BBB {
- public:
- BBB() {}
- operator AAA() { AAA a; return a; }
- };
- int main() {
- BBB b;
- AAA a = {b};
- }
- class CCC {};
- class AAA {
- public:
- AAA() {}
- AAA(const AAA&) {}
- AAA(const CCC&) {}
- };
- class BBB {
- public:
- BBB() {}
- operator CCC() {CCC c; return c;}
- };
- int main() {
- BBB b;
- AAA a = {b};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement