Boost logo

Boost :

Subject: Re: [boost] Official warnings policy?
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2009-11-12 12:16:33


On Thu, Nov 12, 2009 at 11:51 AM, John Maddock <john_at_[hidden]> wrote:
>>> > Indeed, Variant shouldn't suppress the warning, but wasn't the
>>> > original issue because a test was triggering it?  IOW, it is the
>>> > test code that should work around or suppress the warning.
>>>
>>> This is what the test tests. If it "works around the warning"
>>> it is no
>>> longer a test. You may as well remove it, which will also silence the
>>> warning.
>>
>> The test tests that Variant produces a warning?
>
> No the test verifies that:
>
> variant = type-convertible-to-actual-type-in-variant;
>
> works as expected.
>
> The warning is a byproduct of the fact that the type stored in the variant
> is a short, and the type convertible to it is an int.

This may seem too obvious and I'm probably not knowledgeable enough
about the test, but does a widening conversion accomplish the same
thing, only without the warning?

e.g. variant stores int, try to assign short

--Michael Fawcett


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk