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
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to