home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C12 / Fanout.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  412 b   |  25 lines

  1. //: C12:Fanout.cpp
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Type conversion fanout
  7.  
  8. class A {};
  9. class B {};
  10.  
  11. class C {
  12. public:
  13.   operator A() const;
  14.   operator B() const;
  15. };
  16.  
  17. // Overloaded h():
  18. void h(A);
  19. void h(B);
  20.  
  21. int main() {
  22.   C c;
  23. //! h(c); // Error: C -> A or C -> B ???
  24. } ///:~
  25.