Boost logo

Boost :

From: James Dennett (jdennett_at_[hidden])
Date: 2001-09-25 14:21:43

John Maddock wrote:

>>I currently have need of this for Boost.Threads, so... Any thoughts
>>or comments on this?
>Just a thought but whats wrong with:
>(void) parameter_name;
>which suppresses the warning and doesn't generate any code, even when
>inline expansions are turned off in the compiler....
I've previously used a macro along the lines of

#define BOOST_UNUSED_VARIABLE(x) ((void)(x))

which has the same effect but also documents why the line is there.
This was with C code though; for C++ code I've found that it's always
possible to write without naming unused objects, and I prefer to do
so. I'll document in the comments why the argument is there but

-- James Dennett

Boost list run by bdawes at, gregod at, cpdaniel at, john at