Logo Search packages:      
Sourcecode: icu version File versions  Download package

localpointer.h File Reference

C++ API: "Smart pointers" for use with and in ICU4C C++ code. More...

#include "unicode/utypes.h"
Include dependency graph for localpointer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Detailed Description

C++ API: "Smart pointers" for use with and in ICU4C C++ code.

These classes are inspired by

  • std::auto_ptr
  • boost::scoped_ptr & boost::scoped_array
  • Taligent Safe Pointers (TOnlyPointerTo)

but none of those provide for all of the goals for ICU smart pointers:

  • Smart pointer owns the object and releases it when it goes out of scope.
  • No transfer of ownership via copy/assignment to reduce misuse. Simpler & more robust.
  • ICU-compatible: No exceptions.
  • Need to be able to orphan/release the pointer and its ownership.
  • Need variants for normal C++ object pointers, C++ arrays, and ICU C service objects.

For details see http://site.icu-project.org/design/cpp/scoped_ptr

Definition in file localpointer.h.


Generated by  Doxygen 1.6.0   Back to index