[C++-SIG] How to use CXX...

Steve Harris sharris at primus.com
Tue May 23 06:00:06 CEST 2000


"Paul F. Dubois" <dubois1 at llnl.gov> writes:

> It is clear that a Python sequence type is a random access container. The
> class Sequence in CXX is too. If you want to wrap a class that is not a
> random access container, then it isn't a Sequence. You can invent a new
> class for it that is a child of Object in the same way that Sequence is,
> with whatever access rules you think are appropriate, but if your can't do
> x[i] in reasonable time it is simply deceptive to have such an operator.

The syntax I'm looking to enable is just iteration:

  for item in seq
    print item



More information about the Cplusplus-sig mailing list