Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



On Thu, 2012-02-16 at 15:20 -0500, Kohei Yoshida wrote:
Is it a safe code?

     pForbiddenCharacters = &maMap[ nLanguage ];
     return pForbiddenCharacters;
...
So, in theory, taking the address of a returned object which itself is a
reference to the instance stored in the container is very much safe.

        I guess :-) I imagine the real problem here is that any kind of
operation on the stl container could then realloc the underlying memory
in some way, busting the reference / pointer you handed out elsewhere;
so it looks only transiently safe to me ;-)

        Or perhaps I'm missing something,

        ATB,

                Michael.

-- 
michael.meeks@suse.com  <><, Pseudo Engineer, itinerant idiot


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.