Guest User

Untitled

a guest
Nov 24th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. struct T1
  2. {
  3. operator int() const { return 1; }
  4. operator float() const { return 2.0f; }
  5. };
  6.  
  7. template<class T3>
  8. struct T2
  9. {
  10. T2(const T3& t3) { f(t3); }
  11. static void f(int) { }
  12. static void f(float) { }
  13. };
  14.  
  15. int main()
  16. {
  17. T1 t1;
  18. T2<int> t2_1(1);
  19. T2<float> t2_2(2.0);
  20. T2<T1> t2_3(t1);
  21. }
Add Comment
Please, Sign In to add comment