I actually just made it so your template specialization works the way I want. Thanks a bunch!
I simply used a macro to generate specializations for all integers between 0 and ASSERT_MAX_DEBUG_LEVEL, inclusive. For those who are interested:
#include <boost/preprocessor/arithmetic/inc.hpp>#include <boost/preprocessor/comparison/not_equal.hpp>#include <boost/preprocessor/repetition/for.hpp>#include <boost/preprocessor/tuple/elem.hpp>#define PRED(r, state) BOOST_PP_NOT_EQUAL( BOOST_PP_TUPLE_ELEM(2, 0, state), BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 1, state)) ) /**/#define OP(r, state) ( BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 0, state)), BOOST_PP_TUPLE_ELEM(2, 1, state) ) /**///specialized cases#define MACRO(r, state) template <> struct Assert< BOOST_PP_TUPLE_ELEM(2, 0, state) > { Assert(bool test, const char* const msg) { std::cerr << "assertion\n"; } };BOOST_PP_FOR((0, ASSERT_MAX_DEBUG_LEVEL), PRED, OP, MACRO)
basically, what I wanted was to be able to define ASSERT_MAX_DEBUG_LEVEL as some intereger and then all asserts with a level above that would be removed. So if I want to remove all asserts, I make the max -1. If I want to see them all I set it to 100. If I just want to see the major ones, I set it to 3, etc.
Thanks again!
Dwiel