[C++-sig] Re: Wrapping Arrays?

Franz Kaiser chilavert123 at gmx.net
Fri Apr 23 08:35:52 CEST 2004


Hi David,

I have a class which looks like that:

class Bla{
 public:
    ...
    unsigned char scrBits[SCREENS_];
}

Maybe it's not a goot class design but I can't change the class 'cause it's
used by many other classes. The user should be able to use the array like
in C++. This means setting and getting values and iterating through the
array.

Any suggestions (or better code snippets:o) ) would be appreciated.



David Abrahams wrote:

> Franz Kaiser <chilavert123 at gmx.net> writes:
> 
>> Hi,
>>
>> I just wanted to ask if someone could give me a little example of how to
>> wrap a C++ array. I looked at the indexing stuff in the documentation,
>> but it doesn't tell me much.
> 
> You probably need to give more details about what you mean by "wrap a
> C++ array".  What C++ code do you have, and how would you like to use
> it from Python?
> 






More information about the Cplusplus-sig mailing list