
9 Sep
2009
9 Sep
'09
3:26 a.m.
AMDG Michael Fawcett wrote:
On Tue, Sep 8, 2009 at 8:19 PM, Thomas Klimpel<Thomas.Klimpel@synopsys.com> wrote:
I don't think that works with templates. Typically to silence errors in template code, the user must put those pragmas around the point of instantiation.
I hope you're joking.
I wish. That's how it works with MSVC though.
No it doesn't. At least, not in recent versions. The following produces a warning only if I leave the initial #define. #define WARNINGS #ifndef WARNINGS #pragma warning(push) #pragma warning(disable:4244) #endif template<class T> char f(T t) { return t; } #ifndef WARNINGS #pragma warning(pop) #endif int main() { f(1); } In Christ, Steven Watanabe