Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-01 01:55:23


Rene Rivera <grafik.list_at_[hidden]> writes:

> Dear Boosters,
>
> This little utility tries to solve the old problem of compiler warnings
> about unused variables in the least impact way possible.
>
> The solution I ended up implementing is different, hopefully better, than
> the rest of solutions I saw currently in use in Boost:
>
> * (void)variable;
> // Does not working on all compilers.
>
> * template<class T> inline void unused(const T &) {}
> // Additional overhead of templates.

IMO the tiny overhead of instantiating this template is more than
worth it in order to avoid introducing/using another macro.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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