[parameter] non-type template params

Hello all, Does Boost.Parameter support named parameters for non-type template parameters? For example, can I use Boost.Parameter on all the template parameters below including default_value? template< typename Value, Value default_value = Value() > class none { ... };
From the docs, it seems that this is not possible but I might be missing something: http://www.boost.org/doc/libs/1_47_0/libs/parameter/doc/html/index.html#para...
Thanks a lot. --Lorenzo -- View this message in context: http://boost.2283326.n4.nabble.com/boost-parameter-non-type-template-params-... Sent from the Boost - Dev mailing list archive at Nabble.com.

on Mon Oct 24 2011, lcaminiti <lorcaminiti-AT-gmail.com> wrote:
Hello all,
Does Boost.Parameter support named parameters for non-type template parameters?
Not directly. You have to wrap them in types. Sorry, -- Dave Abrahams BoostPro Computing http://www.boostpro.com

Dave Abrahams wrote:
on Mon Oct 24 2011, lcaminiti <lorcaminiti-AT-gmail.com> wrote:
Hello all,
Does Boost.Parameter support named parameters for non-type template parameters?
Not directly. You have to wrap them in types.
I see. For example, something like this-- correct? namespace num { BOOST_PARAMETER_TEMPLATE_KEYWORD(Value) BOOST_PARAMETER_TEMPLATE_KEYWORD(DefaultValue) CONTRACT_CLASS( template( in typename Value, default int, in requires(is_same<typename _::type, Value>) DefaultValue, default int_<0> ) struct (integer) ) { integer ( Value const& i = DefaultValue::value ) : i_(i) {} private: Value i_; }; } // namespace num int main ( ) { num::integer< num::_DefaultValue< int_<10> > > i; num::integer< > j; num::integer< num::_DefaultValue< long_<10> >, num::_Value<long> > l; num::integer< char, char_<'z'> > c; return 0; } --Lorenzo -- View this message in context: http://boost.2283326.n4.nabble.com/boost-parameter-non-type-template-params-... Sent from the Boost - Dev mailing list archive at Nabble.com.
participants (2)
-
Dave Abrahams
-
lcaminiti