Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-04-17 12:14:18


----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, April 17, 2002 11:44 AM
Subject: Re: [boost] Loki Functor

>
> ----- Original Message -----
> From: "Fernando Cacciola" <fcacciola_at_[hidden]>
>
> > Have you thought already about adding the threading policy?
> > The packed interface has the benefit that the template has exactly two
> > arguments, so adding a third optional arg (a policy) is not a problem.
> > I can't think of a way to add an *optional* policy class to function<>
> given
> > its variable arguments.
>
> It's not hard if you're willing to:
>
> 1. Disallow policy types from being passed directly as arguments
> (boost::ref() could be used to get around it)
>
> 2. Ask people to derive their policies from a common base class or
> specialize some traits.
>
>
Yes, I see.
I'm still worried about how it will read from a user pov: "is this an
argument to function<> itself or an argument to the wrapped function?"
But this is my general feeling about policy arguments... or actually, about
'unnamed' arguments.

Well, now we have another reason to bring named template parameters
up-front, and to encourage wide usage of this wonderful idiom. They are a
bit verbose, but cool enough to pay for the extra verbosity.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk