Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-02-28 20:38:02


Tobias Schwinger <tschwinger_at_[hidden]> writes:

> David Abrahams wrote:
>> Tobias Schwinger <tschwinger_at_[hidden]> writes:
>>>
>>>- use at_c for every element
>> Not at all; just use iterators dereference and increment them.
>> boost/python/detail/caller.hpp uses this pattern.
>
> Well, that's nicer in case 'at' has non-constant complexity. Still, I
> find this "surprisingly brutal".

I don't see why. How would you fill up members of a struct with
successive elements of a sequence?

         x.m1 = *i;
         ++i;
         x.m2 = *i;
         ++i
         x.m3 = *i;
         ...

Yes, we have shorthands like *++i, but it amounts to the same thing.

> Can you give me a vague idea of this technique's performance
> (seconds/functions), if recognizable at all ?

I have no data other than that it's "fast enough."

>> This is going to be a job for the PP library, no matter what you do.
>
> Oh! Use it already. My concern was about the preprocessed code (becomes
> huge, causes numerous template instantiations when used and in some way
> obscures the preprocessed headers).

Sounds pretty FUDdy, duddy.

> However, if it works for Boost.Python I'll call it "common practice" and
> just use it ;-).

Hope I helped.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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