Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2003-10-24 02:41:54


David Abrahams wrote:
> Rene Rivera <grafik.list_at_[hidden]> writes:
>
>>I was in the process of looking at some of the build warnings some of which
>>are unused variable warnings. On Dave's suggestion I looked around for how
>>this is solved in other places, and here's what I found.
>>
>>The following is defined/used in many places, in a variety of forms:
>>
>>template <class T> inline void unused_variable(const T&) { }
>
> Reasonable, though "no_unused_warning" might be more self-documenting.

Although it plays better with namespaces, I wonder if a macro would make
sense here:

#define BOOST_NO_UNUSED_VARIABLE_WARNING( x ) (void)x

Given that it works for all situations where needed, I see two (small)
advantages:

1) Less overhead for the compiler, although it's probably already small
enough compared to some other boost libraries

2) The macro's all caps name is IMHO a better hint for the reader that
this is just a workaround for an unwanted compiler warning and not
something clever what the function-style might suggest.

Regards, Daniel

-- 
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

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