A "sanity check" question for language lawyers / nitpickers:
In this snippet of code:
enum my_enum { AValue1, AValue2 };
using alias_1 = enum my_enum;
using alias_2 = my_enum;
can there be any sort of difference between alias_1
and alias_2
? That is, may a compiler treat them differently somehow? My best understanding is that the answer is "no", but a user of mine is experiencing different compiler behavior with the first kind rather than the second kind of statements, when using MSVC 16.8 + CUDA. Something like cannot convert argument 1 from 'my_enum' to 'alias_1'
.
Notes:
- Pathologies like
#define enum
or name hiding are relevant to address in answers, I suppose, but I'm mostly interested in a "non-pathological" situation. - Asking specifically regarding C++11 in case it matters.
- I'm finding it difficult to create an MWE, since I don't have that compiler myself nor do I usually run Windows.