Boost logo

Boost :

Subject: Re: [boost] Standalone boost::ignore_unused_variable_warning()
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-05-19 11:26:49


2014-05-19 17:07 GMT+02:00 Peter Dimov <lists_at_[hidden]>:

> Adam Wulkiewicz wrote:
>
>> There are some problems with the above example but this gave me an idea.
>> The types could be passed as a parenthized list:
>>
>> BOOST_IGNORE_UNUSED_TYPEDEF_WARNING((T1, T2, T3));
>>
>> then internally used e.g. to build some function type or just passed to
>> the
>> BOOST_MPL_ASSERT_MSG as the last parameter.
>>
>> So as a reminder the other approach is:
>>
>> ignore_unused_typedef_warning<T1, T2, T3>();
>>
>
> I'm in favor of
>
> BOOST_IGNORE_UNUSED_TYPEDEF( T1 )
> BOOST_IGNORE_UNUSED_TYPEDEFS(( T1, T2, T3 ))
>
> (Lack of semicolon is intentional and not an omission on my part.)
>
> A macro would allow us to vary the implementation in the appropriate
> compiler-specific way, or to omit it altogether on compilers that do not
> warn.
>
>
Then probably also

boost::ignore_unused_variable(v1) ;
boost::ignore_unused_variables(v1, v2, v3);

for consistency.

Or would putting it in boost::utility/BOOST_UTILITY be a better idea?

Regards,
Adam


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