diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html index 74d9c9083..95a3d054b 100644 --- a/Doc/Manual/SWIGPlus.html +++ b/Doc/Manual/SWIGPlus.html @@ -2763,8 +2763,28 @@ have to handle it like a normal function. For example:
Certain operators are ignored by default. For instance, new and delete operators -are ignored as well as conversion operators. -
+
+example.i:12: Warning 503: Can't wrap 'operator []' unless renamed to a valid identifier. ++
The index operator, operator[], is particularly difficult to overload due to differences in C++ +implementations. Specifically, the get and set operators in other languages typically are separated +into two methods such that additional logic can be packed into the operations; C# uses +this[type key] { get { ... } set { ... }}, Python uses +__getitem__ and __setitem__, etc. In C++ if the return +type of operator[] is a reference and the method is const, it is often indicative of the setter, +and and the getter is usually a const function return an object by value. +In the absence of any hard and fast rules and the fact that there may be multiple index operators, +it is up to the user to choose the getter and setter to use by using %rename as shown earlier. +
+