[concept_check.hpp] unreferenced formal parameter line 227

Hi, I was wondering if anybody has thought about adding a #else to the #if !defined(_ITERATOR) to ignore the unused variable warning in AssignableConcept::const_constraints() you get when compiling on VC7.1 ? (Or am I missing something subtle about the situation) Thanks Kevin -- | Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this | | Senior Technology | My employer for certain | | And Network Systems Architect | Not even myself |

Kevin Wheatley wrote:
Hi,
I was wondering if anybody has thought about adding a #else to the #if !defined(_ITERATOR) to ignore the unused variable warning in AssignableConcept::const_constraints() you get when compiling on VC7.1 ? (Or am I missing something subtle about the situation)
In gcc you can suppress a warning like this by explicitly casting to void: static_cast<void>( x ); Maybe the same method works in VC7 and gives cleaner compilation. -- JDL

John D Lamb wrote:
Kevin Wheatley wrote:
Hi,
I was wondering if anybody has thought about adding a #else to the #if !defined(_ITERATOR) to ignore the unused variable warning in AssignableConcept::const_constraints() you get when compiling on VC7.1 ? (Or am I missing something subtle about the situation)
In gcc you can suppress a warning like this by explicitly casting to void: static_cast<void>( x );
Maybe the same method works in VC7 and gives cleaner compilation.
That works fine everywhere. It's similar to (void)0, which is a popular way to say "do nothing".

Simon Buchan wrote:
That works fine everywhere. It's similar to (void)0, which is a popular way to say "do nothing".
In that file (and else where) there are specific calls to the boost::ignore_unused_variable_warning() mechanism. I wondered if there was a good reason it wasn't done in this case, before assuming it will just work. Kevin -- | Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this | | Senior Technology | My employer for certain | | And Network Systems Architect | Not even myself |

Kevin Wheatley wrote:
Simon Buchan wrote:
That works fine everywhere. It's similar to (void)0, which is a popular way to say "do nothing".
In that file (and else where) there are specific calls to the boost::ignore_unused_variable_warning() mechanism. I wondered if there was a good reason it wasn't done in this case, before assuming it will just work.
Kevin
ignore_unused_variable_warning is defined in workaround.hpp, so I may be wrong that void casting stops the warning everywhere. (usage warnings are pretty fiddly). However, that method works by not giving the parameter a name, which I seem to remember getting warnings for in some compilers. (some versions of GCC?)
participants (3)
-
John D Lamb
-
Kevin Wheatley
-
Simon Buchan