From the proposal for new time classes (N2615)
http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2008/n2615.html#co...
I get this common_type traits
template <class ...T> struct common_type;
template <class T>
struct common_type<T>
{
typedef T type;
};
template <class T, class U>
struct common_type<T, U>
{
private:
static T&& t();
static U&& u();
public:
typedef decltype(true ? t() : u()) type;};
Using gcc 4.3.1, which is the only compiler I have that compiles
it, I tried this simple code:
typedef common_type<int>::type one;
typedef common_type<int, int>::type two;
The compiler seems to agree with me that 'one' is a typedef for
'int' while 'two' is a typedef for'int&&'. Why is that?
is easy done when there is only one type in the set. Along the same
same type - is not any harder. Both of the these cases could be