Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2007-11-28 15:44:57


on Mon Nov 26 2007, StephQ <pelux-AT-ngi.it> wrote:

> Thank you for your previous help with the Boost. Parameter library, I have been
> able to solve my problem.
>
> I would like to know if is it possible in any way to exploit the Boost.
> Parameter library to get a template class with a constructor that automatically
> deduce the correct template parameters.

No, the template parameters of a class template have to be determined
before the invocation of the constructor.

> If not I would like to know if there exist a convenient way to minimize the pain
> resulting from template classes.
> For example now I have to write:
>
> VariateSampler<
> GaussianDistribution,
> MersenneTwisterPseudoRng>
> gaussianSampler( myGenerator, GaussianDistribution() );

You can use "object generators:"
http://www.boost.org/more/generic_programming.html#object_generator
HTH,

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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