Boost logo

Proto :

Subject: Re: [proto] Funky exercie: subset of Boost::parameters using proto
From: Eric Niebler (eric_at_[hidden])
Date: 2010-08-15 17:21:03

On 8/15/2010 2:21 PM, Daniel Wallin wrote:
> On Sun, Aug 15, 2010 at 4:51 PM, joel falcou <joel.falcou_at_[hidden]>
> wrote:
>> So, Thomas and I felt bored or some suhc this afternoon.
>> Incidentally, I needed to use Boost::Parameters in NT² but found
>> the compile time to be somehow slow. So in a flash of defiance, we
>> went to reimplementing a subset of parameters using proto
> So you implemented something significantly slower (3 times on
> machine with gcc4.3). Not very surprising; adding complex abstraction
> in the implementation rarely makes things faster.
> Here's the Boost.Parameter version, for reference:

Haha! I admit I was a bit suspicious at first. Nobody ever said, "Wow,
Proto sped up my compiles!" ;-)

But looking at Joel's implementation, I suspect it can be sped up
considerably by avoiding fusion vectors and maps. (I've found fusion to
be costly at compile time and generally avoid it in Proto.) I don't see
a reason why the proto expression tree can't directly serve the same
role as the fusion map. Just define a transform instead of using

Regardless, a nifty hack, and amazing you could do this in a few hours.

Eric Niebler
BoostPro Computing

Proto list run by eric at