On 2012-09-28 15:55, Norbert Thiebaud wrote:
On Fri, Sep 28, 2012 at 7:17 AM, Noel Grandin <[email protected]> wrote:
That is exactly what makes it weird - it looks like a Java String, but it's
not, because you can do this:

     void f(OUString s) {
          s = "2";
     }

     OUString s = "1";
     f(s);
     cout << s; // will print "2"

ie. the modification inside the method is visible outside the method.
Really ? it does that ?
Whoaa, that is unexpected, and way wrong. That should be considered
'entrapment' :-/

Norbert



Sorry, that example code should read (note that the parameter is now a reference param)

    void f(OUString & s) {
         s = "2";
    }

    OUString s = "1";
    f(s);
    cout << s; // will print "2"



Disclaimer: http://www.peralex.com/disclaimer.html


_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to