#include #include #include #include enum negatives_options { default_option, option_1, option_2, option_3, }; struct fixedlength_base_t { }; struct negatives_base_t { }; struct secure_base_t { }; template struct fixedlength_t: public boost::mpl::size_t, public fixedlength_base_t { }; template struct negatives_t: public boost::mpl::integral_c, public negatives_base_t { }; template struct secure_t: public boost::mpl::bool_, public secure_base_t { }; BOOST_PARAMETER_TEMPLATE_KEYWORD(fixedlength) BOOST_PARAMETER_TEMPLATE_KEYWORD(secure) BOOST_PARAMETER_TEMPLATE_KEYWORD(negatives) BOOST_PARAMETER_TEMPLATE_KEYWORD(allocator) using boost::parameter::optional; using boost::parameter::deduced; using boost::mpl::_; using boost::is_base_of; using boost::is_class; typedef boost::parameter::parameters< optional, is_base_of >, optional, is_base_of >, optional, is_base_of >, optional, is_class<_> > > integer_signature; template < class A0 = boost::parameter::void_, class A1 = boost::parameter::void_, class A2 = boost::parameter::void_, class A3 = boost::parameter::void_ > class integer_t { public: typedef typename integer_signature::bind::type args; typedef typename boost::parameter::binding >::type fixedlength; typedef typename boost::parameter::binding >::type negatives; typedef typename boost::parameter::binding >::type secure; typedef typename boost::parameter::binding >::type allocator; static void report() { using std::cout; using std::endl; cout << "Length: " << fixedlength::value << endl; cout << "Negatives option: " << negatives::value << endl; cout << "Secure: " << (secure::value ? "true" : "false") << endl; cout << "Allocator type size: " << sizeof(typename allocator::value_type) << endl; } }; int main() { integer_t< std::allocator, negatives_t, fixedlength_t<128> >::report(); return 0; }