
Michael Marcin wrote:
A long time ago I read a post that mentioned a standard way to disable unused variable warnings in boost. Specifically this one:
Although a trivial utility it seems generally useful to me and I was wondering if it existed in boost as a utility somewhere.
It seems silly to recreate that function every time you need to disable such a warning.
Dave suggests two possibilities - and I prefer the second, plus a comment: void f( int /*unused*/ ) Which does not instantiate a template and is a clear and documented way to show that you really meant to have a parameter which is not used. As a third option, we could add #define BOOST_UNUSED_PARAMETER and use it like this: void f( int BOOST_UNUSED_PARAMETER ) just in case you want to avoid block-comments in your code. Regards, Daniel