Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-09-25 07:50:42


--- In boost_at_y..., Darin Adler <darin_at_b...> wrote:
> Discussing: template <class T> inline void unused_variable(const
T&) { }
>
> on 9/24/01 1:30 PM, williamkempf_at_h... wrote:
>
> > I currently have need of this for Boost.Threads, so... Any
thoughts
> > or comments on this?
>
> Great idea.
>
> I also encountered this in tuple/test/tuple_test_bench.cpp. It's
named
> "dummy" in there.
>
> I like the name unused_variable.
>
> I also seem some benefit, and little harm, in having another
function
> template called unused_variables that takes multiple parameters as
suggested
> by Fernando Cacciola.

The "harm" is mostly in the implementation. How many parameters to
you allow? Most such multi-parameter templates in Boost are moving
towards you the preprocessor library to generate the repetitious code
for this, but that's a lot of plumbing for an extremely simple
concept just used to shut the compiler up. It just seems the cost
(compile times, file size, header dependencies) outweigh the benefit
(a little saved typing). But I won't argue too strongly on this one.

Bill Kempf


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