[boost-users] Boost.Parameter: ArgumentPack - is type contained
Hi, I'm trying to test an ArgumentPack for containment of a certain parameter. Since an ArgumentPack is a valid MPL Sequence, I think boost::mpl::contains should do the trick, but I fail to specify the correct type. Consider the following BOOST_PARAMETER_NAME(color); template<class Opts> void function_with_opts(const Opts &opts) { boost::mpl::contains<Opts, /* what type goes here if I'd like to test if color is present in Opts ? */ > )); } Best regards, Christoph
At Tue, 29 Mar 2011 21:22:04 +0200, Christoph Heindl wrote:
Hi,
I'm trying to test an ArgumentPack for containment of a certain parameter. Since an ArgumentPack is a valid MPL Sequence, I think boost::mpl::contains should do the trick, but I fail to specify the correct type. Consider the following
BOOST_PARAMETER_NAME(color);
template<class Opts> void function_with_opts(const Opts &opts) { boost::mpl::contains<Opts, /* what type goes here if I'd like to test if color is present in Opts ? */ > )); }
try !boost::is_void< typename parameter::binding<Opts, tag::color, void>::type , void
::value
HTH -- Dave Abrahams BoostPro Computing http://www.boostpro.com
On Wed, Mar 30, 2011 at 12:29 AM, Dave Abrahams <dave@boostpro.com> wrote:
try
!boost::is_void< typename parameter::binding<Opts, tag::color, void>::type , void >::value
Thanks, will give it a try! Best regards, Christoph
participants (2)
-
Christoph Heindl
-
Dave Abrahams