Boost logo

Boost :

From: John (john_at_[hidden])
Date: 2003-06-16 03:30:38


>
>Subject: Re: [boost] BOOST_STATIC_WARNING ?
> From: "John Maddock" <john_maddock_at_[hidden]>
> Date: Sun, 15 Jun 2003 12:55:15 +0100
> To: "Boost mailing list" <boost_at_[hidden]>
>
>> I find BOOST_STATIC_ASSERT(...) extremely useful.
>>
>> I would also find BOOST_STATIC_WARNING(...) extremely useful.
>>
>> I've looked in boost and now found such a thing. Am I missing
>> something? Is there something equivalent? Can such a thing
>> be added?
>>
>> I envision an implementation of BOOST_STATIC_WARNING that
>> would display a compile time warning message but permit
>> compilition to successfully complete. Its usage would be
>> to notify library users of legal but suspect library usage.
>
>I agree on it's usefulness, but there's no real way to implement it IMO,
>

Another problem (I think) is that with BOOST_STATIC_ASSERT you know compilation will stop.

However, a BOOST_STATIC_WARNING would keep re-apearing in each translation unit #including your file:

// boost_file.hpp

BOOST_STATIC_WARNING( "we're in boost_file.hpp")

// file1.hpp
#include <boost/boost_file.hpp>

-- appears here

// file2.hpp
#include <boost/boost_file.hpp>

-- appears here too!

Best,
John


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