[C++-sig] [ vector | list ] indexing suite

Roman Yakovenko roman.yakovenko at gmail.com
Tue Jun 20 13:56:20 CEST 2006


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?

I attach the modified file.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector_indexing_suite.hpp
Type: application/octet-stream
Size: 8335 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20060620/38138b61/attachment.obj>


More information about the Cplusplus-sig mailing list