language: C++ 4.7.2 (gcc-4.7.2)
date: 462 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
 
template <typename T1>
inline bool test(T1 x, T1 s, T1 e)
{
  std::cout << "generic" << std::endl;
  return (s <= x && x <= e);
}
 
template <typename T1, typename T2>
inline bool test(T1 x, T1 s, T2 e)
{
  std::cout << "different T2" << std::endl;
  return (s <= x && x <= e);
}
 
template <typename T1, typename T2, typename T3>
inline bool test(T1 x, T2 s, T3 e)
{
  std::cout << "different T3" << std::endl;
  return (s <= x && x <= e);
}
 
int main(void)
{ 
  test(1, 2, 3);
  test(1, 2, 3.);
  test(1, 2L, 3.);
}