info/CWS dba34a : new: comphelper::FlagGuard

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

info/CWS dba34a : new: comphelper::FlagGuard

Frank Schönheit


          Type: info
         Title: new: comphelper::FlagGuard
     Posted by: [hidden email]
      Affected: -
Effective from: CWS dba34a
           CWS:
<http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300/dba34a>
    CWS status: ready for QA


*Summary*
--------
+ comphelper/scopeguard.hxx: class FlagGuard

*Description*
-------------
The new class ::comphelper::FlagGuard, defined in
comphelper/scopeguard.hxx, is a specialization of
::comphelper::ScopeGuard, implementing the pattern (seen multiple
times all around the code) of resetting a flag when leaving a scope.

I.e.
  {
    someFlag = true;
    FlagGuard aGuard( someFlag );
    ...
  }

will ensure that at the end of the scope, "someFlag" has the value
"false", no matter how and where the scope is left.


Send feedback to [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]