Здравствуйте, Кодт, Вы писали:
К>Прикольно! Внешнее определение шаблона члена-функции включает опцию /Zc:forScope- ! К>Причём до определения шаблона и в самом определении — действует дефолтное поведение forScope+.
Я подозреваю, что это связано с POI.
Опять доставать с пыльной полки #define for if(0); else for?
a.cpp(23) : warning C4258: 'i' : definition from the for loop is ignored; the definition from the enclosing scope is used
a.cpp(22) : definition of 'i' ignored
a.cpp(18) : definition of 'i' used
a.cpp(36) : warning C4258: 'i' : definition from the for loop is ignored; the definition from the enclosing scope is used
a.cpp(35) : definition of 'i' ignored
a.cpp(18) : definition of 'i' used
a.cpp(30) : warning C4258: 'i' : definition from the for loop is ignored; the definition from the enclosing scope is used
a.cpp(29) : definition of 'i' ignored
a.cpp(18) : definition of 'i' used
a.cpp(12) : see reference to function template instantiation 'void Foo::barT<float>(void)' being compiled
Linking...
Output:
12345
12345
12345
Press any key to continue . . .
У меня VC8 при компиляции большого проекта падает на каждом шагу
Так что это еще ничего.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
forScope.cpp
forScope.cpp(1) : warning C4811: value of pragma conform(forScope, show) == true
forScope.cpp(11) : warning C4811: value of pragma conform(forScope, show) == false
Expected Results
forscope.cpp(1) : warning C4811: value of pragma conform(forScope, show) == true
forscope.cpp(11) : warning C4811: value of pragma conform(forScope, show) == true