Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class AAA {
  2. public:
  3. AAA() {}
  4. AAA(const AAA&) {}
  5. };
  6.  
  7. class BBB {
  8. public:
  9. BBB() {}
  10. operator AAA() { AAA a; return a; }
  11. };
  12.  
  13. int main() {
  14. BBB b;
  15. AAA a = {b};
  16. }
  17.  
  18. class AAA {};
  19.  
  20. class BBB {
  21. public:
  22. BBB() {}
  23. operator AAA() { AAA a; return a; }
  24. };
  25.  
  26. int main() {
  27. BBB b;
  28. AAA a = {b};
  29. }
  30.  
  31. class CCC {};
  32.  
  33. class AAA {
  34. public:
  35. AAA() {}
  36. AAA(const AAA&) {}
  37. AAA(const CCC&) {}
  38. };
  39.  
  40.  
  41. class BBB {
  42. public:
  43. BBB() {}
  44. operator CCC() {CCC c; return c;}
  45. };
  46.  
  47. int main() {
  48. BBB b;
  49. AAA a = {b};
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement