[C++-sig] [ vector | list ] indexing suite
Niall Douglas
s_sourceforge at nedprod.com
Tue Jun 20 21:59:51 CEST 2006
On 20 Jun 2006 at 14:56, Roman Yakovenko wrote:
> Hi. While working on adding support to pyplusplus for indexing suite,
> I took a look on
> vector_indexing_suite.
>
> I think that with a small change of code it is possible to make
> "vector_indexing_suite" class
> to work with std::list. The change is simple: to replace operator[]
> and iterator += ( Distance )
> with std::advance( iterator, Distance ). I am almost sure that there
> is no performance
> penalties for this change.
>
> What do you think? Am I missing some trivial reason why this change
> could not be done?
You would be far better off using the new and improved indexing
suite. It's still sitting in CVS on some experimental branch. It is a
lot more efficient, already automatically interfaces with std::list
and std::vector and also can be easily extended to handle any
arbitrary kind of container.
TnFOX uses the new indexing suite. Saved me hours of extra work.
Search the mailing list archives for Raoul Gough.
Cheers,
Niall
More information about the Cplusplus-sig
mailing list