Boost logo

Boost Users :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2007-07-28 04:00:19


Daniel Wallin <daniel <at> boost-consulting.com> writes:

>
> JOAQUIN LOPEZ MU?Z wrote:
[...]
> > I've read this over and over and can't say whether you're correcting
> > Dave or me :( excuse my incompetence. So, given (in the context
> > of class template parameters)
> >
> > required<deduced<tag::T>,F>,
> >
> > can Boost.Parameter match it to T<X> even if X does *not*
> > satisfy F? Thank you!
>
> Yes, that is correct. However, is you use `parameters::match<>` to
> restrict a function template, SFINAE will kick in. For example:
>
> BOOST_PARAMETER_FUNCTION((void), f, tag,
> (deduced
> (required (x, (std::string)))
> )
> );
>
> f(x = 10); // no overload matches

OK, thanks for the info! Since it's only class templates that
I'm interested, the behavior is exactly what I need.

In the meantine, I've tried the lib and learnt the additional
fact that, for

  required<deduced<tag::T>,F>,

if T<X> is passed and T<X> (rather than X) satisfies F,
then Boost.Parameter returns X as the matched arg rather
than T<X>. Not that this poses any particular difficulty
with what I'm trying to use the lib for, but it's a
somewhat corner case I'd like to share with you.

BTW, Boost.Parameter is a pleasure to work with! I hope
to be able to show soon a B.P-powered lib where your
stuff makes it a joy, both for the lib writer and the user,
to deal with class templates with lots of parameters.

Best,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net