[C++-sig] wrapped std::vector slice affecting items in a python list
Babak Khataee
babakage at gmail.com
Wed Aug 17 20:22:11 CEST 2011
okay cool. I think that's a reasonable compromise. It should also
(hopefully) make it possible to move away from the indexing suite as well.
thanks for your help!
On 16 August 2011 21:41, Jim Bosch <talljimbo at gmail.com> wrote:
> On 08/16/2011 11:29 AM, Babak Khataee wrote:
>
>> Okay thanks for the info.
>>
>> Things are also a lot safer if you only wrap vectors as const; it's
>> exposing the mutators to Python that gets really difficult.
>>
>>
>> Is the const-ness of a wrapped object just a side effect of not exposing
>> methods which modify it or is it due to something else more explicit ?
>>
>
> The former. It's really only the methods that can invalidate iterators
> (i.e. those that add or remove elements) that you need to worry about.
> Non-const access to individual elements is totally safe on its own.
>
> Jim
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20110817/675a378f/attachment.html>
More information about the Cplusplus-sig
mailing list