Boost logo

Boost :

Subject: Re: [boost] [msvc] #warning preprocessor directive
From: Robert Ramey (ramey_at_[hidden])
Date: 2017-10-17 16:22:06


On 10/17/17 9:04 AM, Beman Dawes via Boost wrote:
> On Tue, Oct 17, 2017 at 11:30 AM, Robert Ramey via Boost <
> boost_at_[hidden]> wrote:
> ...
>
>> What I have always wanted is the equivalent of static_warning(condition,
>> message). Of course this would be like static_assert except that it
>> wouldn't be an error. The need for this comes up when I can detect at
>> compile time that something is likely not what the user intended, but is
>> not necessarily wrong. One example of this would be an attempt to
>> serialize some data type via a non const reference. This would work, but
>> it leaves open that possibility that the users serialize functions alter
>> the data being serialized, which would break the presumptions made by the
>> serialization library.
>>
>
> That thought occurred to me after I posted the original message, so you are
> way ahead of me:-)

FYI - I made multiple attempts to implement BOOST_STATIC_WARNING as a
element in the boost serialization library similar to
BOOST_STATIC_ASSERT. They had occasional limited success but depended
on specific compiler behavior.

>
> --Beman
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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