|
Boost Users : |
From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2007-07-19 15:18:58
----- Mensaje original -----
De: David Abrahams <dave_at_[hidden]>
Fecha: Jueves, Julio 19, 2007 9:06 pm
Asunto: Re: [Boost-users] [parameter] Parameter-Enabled Class
Templates:combining keyword and deduction for the same parameter
Para: boost-users_at_[hidden]
>
> on Thu Jul 19 2007, Joaquín Mª López Muñoz <joaquin-AT-tid.es> wrote:
>
> > The docs explain that a parameter can be named:
> >
> > typedef parameter::parameters<
> > required<tag::threading_policy>
> > ...
> > > class_signature;
> > ...
> > class_<threading_policy<single_threaded>,...>;
> >
> > or else be deduced:
> >
> > typedef parameter::parameters<
> > required<
> > deduced<tag::threading_policy>,
> > is_base_and_derived<threading_policy_marker,_>
> > >
> > ...
> > > class_signature;
> > ...
> > class multithreaded: threading_policy_marker{...};
> > class_<multithreaded,...>;
> >
> > Now, is it possible to combine these two options into one, so
> > that the two syntaxes
> >
> > class_<threading_policy<single_threaded>,...>;
> > class_<multithreaded,...>;
> >
> > are accepted? If so, how?
>
> Just used deduced<tag::threading_policy>; deduced parameters can be
> deduced from argument types or from the names attached to named
> arguments.
Just to be sure: so, given the parameter specification
required<deduced<tag::T>,F>,
Boost.Parameter matches it to T<X> even if X does *not* satisfy
F, correct?
Thank you,
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