implicit conversion from void to T and T to void?
Jan 9, 2022 at 5:12pm UTC
Hi,
Looking at the code for Loki (Andrei Alexandrescu) there appear to be code that says that there is an implicit conversion from void to T and from T to void where T is any type...
1 2 3 4 5 6 7 8 9 10 11 12
template <class T>
struct Conversion<void , T>
{
enum { exists = 1, exists2Way = 0,sameType = 0 };
};
template <class T>
struct Conversion<T, void >
{
enum { exists = 1, exists2Way = 0,sameType = 0 };
};
But this does not make sense!
Regards,
Juan
Jan 10, 2022 at 8:24am UTC
You need to see this in context. Loki was full of mind/compiler bending tricks to achieve particular results.
Re-read section 2.7 and come back if you still have questions.
Topic archived. No new replies allowed.