|
Boost : |
Subject: Re: [boost] [warnings] Are warnings acceptable artifactsfrom builds?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-09-08 23:26:41
AMDG
Michael Fawcett wrote:
> On Tue, Sep 8, 2009 at 8:19 PM, Thomas
> Klimpel<Thomas.Klimpel_at_[hidden]> 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk