Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct T1
- {
- operator int() const { return 1; }
- operator float() const { return 2.0f; }
- };
- template<class T3>
- struct T2
- {
- T2(const T3& t3) { f(t3); }
- static void f(int) { }
- static void f(float) { }
- };
- int main()
- {
- T1 t1;
- T2<int> t2_1(1);
- T2<float> t2_2(2.0);
- T2<T1> t2_3(t1);
- }
Add Comment
Please, Sign In to add comment