//Purpose: // Test whether a placeholder is required // as one of template args to concept. // //Purpose: // Try various simple concepts to try and get // an idea of what's required of a concept. // #include #include #include #include #include #include namespace mpl = boost::mpl; using namespace boost::type_erasure; typedef int val_t; //#define MODEL_DEFAULT_SELF #ifdef MODEL_DEFAULT_SELF #define MODEL_DEFAULT_TYPE _self #else #define MODEL_DEFAULT_TYPE val_t #endif template < class Model=MODEL_DEFAULT_TYPE > struct concept { static void apply ( Model&model ) { std::cout<<":apply("< , typeid_<> > > a_any(a_empty); empty e = any_cast(a_any); std::cout<<":e="< c; #ifndef MODEL_DEFAULT_SELF val_t y=999; #endif call ( c #ifdef MODEL_DEFAULT_SELF , a_any #else , y #endif ); return 0; }