Implement senf::IGNORE and replace all casts-to-void with senf::IGNORE() calls
[senf.git] / senf / Utils / Console / ParsedCommand.mpp
index 340e073..a501d4a 100644 (file)
@@ -40,6 +40,7 @@
 #include <boost/bind.hpp>
 #include <boost/mpl/vector.hpp>
 #include <boost/mpl/at.hpp>
+#include "senf/Utils/IgnoreValue.hh"
 
 // ///////////////////////////mpp.p////////////////////////////////////////
 #elif BOOST_PP_IS_ITERATING // ////////////////////////////////////////////
@@ -260,7 +261,7 @@ v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command)
     if ( nArgs > BOOST_PP_ITERATION() )
         throw SyntaxErrorException("invalid number of arguments");
     int nDefaults ( BOOST_PP_ITERATION() - nArgs );
-    (void) nDefaults;
+    senf::IGNORE( nDefaults );
 
     typedef typename boost::range_reverse_iterator<const ParseCommandInfo::ArgumentsRange>::type
         riterator;
@@ -302,7 +303,7 @@ v_execute(boost::any & rv, std::ostream & os, ParseCommandInfo const & command)
     if ( nArgs > BOOST_PP_ITERATION() )
         throw SyntaxErrorException("invalid number of arguments");
     int nDefaults ( BOOST_PP_ITERATION() - nArgs );
-    (void) nDefaults;
+    senf::IGNORE( nDefaults );
 
     typedef typename boost::range_reverse_iterator<const ParseCommandInfo::ArgumentsRange>::type
         riterator;
@@ -356,7 +357,7 @@ struct CreateParsedCommandOverload<Traits, true, BOOST_PP_ITERATION()>
 template <BOOST_PP_ENUM_PARAMS( BOOST_PP_ITERATION(), class A ) > 
 next_type arg ( BOOST_PP_ENUM_BINARY_PARAMS( BOOST_PP_ITERATION(), A, const & a ),
                 typename arg_params::match< BOOST_PP_ENUM_PARAMS( BOOST_PP_ITERATION(), A ) >::type
-                    kw = arg_params()) const {
+                    kw = arg_params()) {
     return argInfo( kw(BOOST_PP_ENUM_PARAMS( BOOST_PP_ITERATION(), a )) );
 }