Code: Select all
struct Comparable
{
template
friend bool operator(T const &value, Comparable zero) { return zero < value; }
};
template
struct Conditional;
template
struct Conditional
{
Comparable test;
};
template
struct Conditional
{
template
void test(Comparable) { }
};
void bar() { }
template
void foo(T arg)
{
Conditional().test(Comparable());
Conditional().test(Comparable());
}
int main() { foo(bar); return 0; }
< /code>
Während Clang diesen Code fein kompiliert, gibt GCC ein -wings-Template-Keyword < /code> Warnung aus, und MSVC erstreckt sich unter /permission-
Ich finde, dass dies verblüffend: < /p>
Msvc bis unangenehme bis zu einem steigenden, br />