return config(); } bool empty() const { return true; } private: const filter_context & fc_; }; /// This enum helps to evaluate conditional filters namespace conditional { MAKE_ENUM (TYPE, (AND, "and") (OR, "or") (NOT, "not") ) } /// The basic unit filter gives a generic implementation of the match fcn class basic_unit_filter_impl : public unit_filter_abstract_impl { public: basic_unit_filter_impl(const vconfig & vcfg, const filter_context & fc, bool flat_tod) : fc_(fc) , vcfg(vcfg) , use_flat_tod_(flat_tod) , cond_children_() , cond_child_types_() {
See the COPYING file for more details. */ #define GETTEXT_DOMAIN "wesnoth-test" #include <boost/test/unit_test.hpp> #include "make_enum.hpp" #include "util.hpp" namespace foo { MAKE_ENUM(enumname, (con1, "name1") (con2, "name2") (con3, "name3") ) MAKE_ENUM_STREAM_OPS1(enumname) } //generates an enum foo::enumname with lexical casts /* namespace foo { enum enumname {con1, con2 ,con3} } foo::enumname lexical_cast<std::string> ( std::string str ) throws bad_lexical_cast {
int main( int argc, char *argv[] ) { MAKE_ENUM( a, b, c ); printf( "a = %d, b = %d, c = %d\n", a, b, c ); return 0; }