Boost logo

Proto :

Subject: Re: [proto] Funky exercie: subset of Boost::parameters using proto
From: Eric Niebler (eric_at_[hidden])
Date: 2010-08-16 16:49:18

On 8/16/2010 2:11 AM, joel falcou wrote:
> On 15/08/10 23:21, Eric Niebler wrote:
>> Haha! I admit I was a bit suspicious at first. Nobody ever said,
>> "Wow, Proto sped up my compiles!" ;-)
> I wish :)
>> 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.)
> Yup, same experience here. I dunno if it comes fromthe TMP part of
> the PP part tough
>> 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 fusion::at_key.
> Hmmm, how should this transform work ? We already capture the value
> of the parmaeters by value in the tree so it can actually be used
> for this but I admit the transform is not trivial.

See attached. Not trivial, but not too difficult, either. I haven't run
any (compile-time) perf benchmarks. This captures everything by
reference and should have zero runtime overhead. If compile times are
bad, you of course have the option of replacing composite transforms
with custom primitive ones. Or use precompiled headers, of course.

Eric Niebler
BoostPro Computing

Proto list run by eric at