
Hi
I have some non-compiling code, and I'd like to know if it's a compiler
bug, or something I'm doing wrong.
In the following code (it's a simplified version of the real code where
I met the problem) the call to F<int> instantiates S<int>. I think the
compiler should choose the specialized version of S<>, but it seems to
use the primary template instead, leading to an invalid non-lvalue int
-> int& conversion.
Strangely, if I explicitly instantiate S<int> (uncomment the commented
line), then it compiles fine.
I also tried implementing enable_if and is_fundamental myself, and came
to the exact same results.
Also tested that version (with the custom enable_if and is_fundamental)
with the online Comeau compiler, and it compiled fine.
So, I'd like to know whether this stuff should work according to the
standard, and if not, why; and if anyone could suggest a workaround that
works with VC++ 7.1.
Thanks,
Imre
Here's the code:
#include
participants (1)
-
Imre