diff --git a/SWIG/Doc/Manual/SWIG.html b/SWIG/Doc/Manual/SWIG.html index 580559b13..4198a650c 100644 --- a/SWIG/Doc/Manual/SWIG.html +++ b/SWIG/Doc/Manual/SWIG.html @@ -42,7 +42,7 @@
  • Linking to structure variables
  • Linking to char *
  • Arrays -
  • Creating read-only variables +
  • Creating read-only variables
  • Renaming and ignoring declarations
  • Default/optional arguments
  • Pointers to functions and callbacks @@ -1542,7 +1542,7 @@ void pathname_set(char *value) { In the target language, the value can be set like a normal variable.

    -

    5.4.6 Creating read-only variables

    +

    5.4.6 Creating read-only variables

    @@ -1567,13 +1567,36 @@ immutable. For example:

    -%immutable x;               // Make x read-only
    +%immutable x;                   // Make x read-only
     ...
    -double x;                   // Read-only (from earlier %immutable directive)
    -double y;                   // Read-write
    +double x;                       // Read-only (from earlier %immutable directive)
    +double y;                       // Read-write
     ...
    -
    -
    + + +

    +The %mutable and %immutable directives are actually +%feature directives defined like this: +

    + +
    +#define %immutable   %feature("immutable")
    +#define %mutable     %feature("immutable","")
    +
    + +

    +If you wanted to make all wrapped variables read-only, barring one or two, it might be easier to take this approach: +

    + +
    +%immutable;                     // Make all variables read-only
    +%feature("immutable","0") x;    // except, make x read/write
    +...
    +double x;
    +double y;
    +double z;
    +...
    +

    Read-only variables are also created when declarations are declared as const. @@ -1584,8 +1607,7 @@ For example:

     const int foo;               /* Read only variable */
     char * const version="1.0";  /* Read only variable */
    -
    - +

    Compatibility note: Read-only access used to be controlled by a pair of directives