[C++-sig] Re: Example of use of indexing_suite NOT using the STL

David Abrahams dave at boost-consulting.com
Sat Oct 11 01:10:05 CEST 2003


Raoul Gough <RaoulGough at yahoo.co.uk> writes:

> "Niall Douglas" <s_sourceforge at nedprod.com> writes:
>
> [snip]
>> I read your docs but like most of the boost.python stuff I don't get 
>> most of it. This is probably mostly my fault, however I understand 
>> loki's documentation fine so I think it's a strong case of writing 
>> style ie; yours is not how I think or how I write my documentation.
>
> I haven't seen the loki documentation, but maybe I should have a look
> at it. I have to agree with you about the documentation being hard to
> follow - mostly, it makes sense only once you've already figured it
> out some other way. The trouble is probably that it is written mostly
> as a reference instead of being a tutorial or user guide. Both types
> are important to have, IMHO.

Well, we have Joel's tutorial.  As for implementation documentation,
I'm trying to get Synopsis to do something useful with the source
tree, with the help of its maintainer.

>> As with Boost.Python, it's likely I'll just have to plough through 
>> the source code which TBH I find about as easy as the docs :( At 
>> least I suppose both together must make for something better than 
>> either alone.
>>
>>> Details of getting the new suite from CVS are in my message "New
>>> indexing suite available on indexing_v2 branch" from 2003/10/07.
>>> 
>>> BTW, I plan to add support for overriding parts of the existing
>>> algorithms with an extra template parameter - for instance, if your
>>> container uses different names for "begin" and "end", it would be
>>> possible to override the two relevant static functions in an existing
>>> algorithms class via the curiously recurring template pattern.
>>
>> Can I use your suite and not have begin() or end() methods? Indeed, a 
>> C array doesn't even have length!
>
> Well, that's actually not too hard. I haven't yet documented the
> iterator_pair template, but you can probably figure it out from the
> the getArray function in libs/python/test/testlinear.cpp
>
> BTW, the suite definitely wants to know how long the array is. If you
> really want to disable the bounds checking, you could probably just
> pretend that the array is "really long" by adding a big number to the
> start address.

Doubtless that'll get you undefined behavior, but you'll probably get
away with it anyway.

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





More information about the Cplusplus-sig mailing list