|
Boost : |
Subject: Re: [boost] [functors] proposal
From: Piotr Wygocki (vwygos_at_[hidden])
Date: 2013-10-23 09:10:23
Sure, but
1) Not everybody can construct the class using make_Algorithm.
(decltype(make_Algorithm()) looks weird).
2) You need many overloads of make_Algorithm function (the number of
overloads equals number of arguments + 1).
In my solution you need only one overload.
Regards,
Piotr
On 23 October 2013 15:01, Krzysztof Czainski <1czajnik_at_[hidden]> wrote:
> 2013/10/23 Piotr Wygocki <vwygos_at_[hidden]>
>
> > I'd like to reestablish my use case. My previous post was messy (sorry!).
> > We've got a class which can be modified by some functors.
> > This functors have default values:
> >
> > template <typename SomeAction = SkipFunctor, typename StopCondidtion
> > =ReturnFalseFunctor>
> > struct Algorithm {
> > Algorithm(SomeAction action = SomeAction(), StopCondidtion =
> > StopCondition());
> >
> > };
> >
> > Could you solve this using constructions from phoenix?
> > The second question is of course: is this a good design?
> >
>
> Aha,
>
> so would something like removing the defaults from the class Algorithm, and
> providing a set of make_Algorithm functions solve your problem?
>
> HTH,
> Kris
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk