Boost logo

Boost Users :

Subject: Re: [Boost-users] [General] Warnings and pragmas in MSVC
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2009-01-14 15:30:32


Robert Jones wrote:

> Gevorg Voskanyan wrote:
>> Just out of curiosity, why do you put #pragma warning( push/pop ) around your .cpp file's content? Do some other files #include your .cpp?

> Good point, to which the answers are (a) Stupidity & (b) No, which means you have almost
> solved my problem!

> It would still seem reasonable to put push/pop around a single function tho', which also fails
> to silence the warning.

> Thanks very much.

> Rob.

Glad it helped :)
Trying to silence the warning locally for a function where boost.lambda is used does not work because apparently it is required the warning to be disabled both at the point of instantiation (in your function) AND at template definition (in boost.lambda headers) for msvc not to issue the warning. That is easily achieved if you disable the warning at the beginning of the .cpp file and leave it disabled throughout it.
<caveat> This explanation of msvc behavior is based on my guess only, haven't tried that. </caveat>

Best Regards,
Gevorg

      


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net