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

Raoul Gough RaoulGough at yahoo.co.uk
Fri Oct 10 11:40:08 CEST 2003


"Niall Douglas" <s_sourceforge at nedprod.com> writes:

> Hi,
>
> Google nor list archives make any mention of using indexing_suite 
> with a custom container class ie; not a STL one.
>
> Is there such an example, and if so where is it?
>
> Would the new indexing::container_suite be better suited for new code 
> as I saw mention of indexing_suite getting retired?

Well, the old indexing suite was certainly extensible, since you can
override any/all of the static functions (with the curiously recurring
template pattern). I don't know of any actual examples, though, except
for the vector and map extensions themselves.

In any case, it might well be better to look at the new suite, since
that is starting to look like it will eventually replace the old
one. Creating a new binding for the suite could be reasonably easy,
depending on how weird the container is. If it is similar to an
existing container, you should be able to get away with creating a new
container_traits class and substituting that in an existing algorithms
instance (e.g. set_algorithms<my_container_traits>). The documentation
should describe how to do this, so any comments on using it would be
appreciated.

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.

-- 
Raoul Gough.
(setq dabbrev-case-fold-search nil)





More information about the Cplusplus-sig mailing list