Boost logo

Boost :

Subject: Re: [boost] [warnings] Are warnings acceptable artifactsfrom builds?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-09-08 23:26:41


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)

template<class T>
char f(T t) { return t; }

#ifndef WARNINGS
#pragma warning(pop)

int main() {

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at