- Added notes on glib::string, glib::RefPtr<> e the c++ stdlib

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@189 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-01-24 21:48:52 +00:00
parent 7248e4026e
commit 7f8760539c
1 changed files with 18 additions and 0 deletions

View File

@ -581,6 +581,24 @@ examples of these operators are: the casting operator,
@code{operator delete}, @code{operator new},
@code{operator ^}.
@item
The C++ standard library is your best friend. For example,
if you need to allocate some temporary variable on the heap,
use an @code{auto_ptr<>} that does the right thing even when
an exception is raised, and that respects
@acronym{RAII,Resource Acquisition Is Initialization}.
Also using extensively algorithms like @code{for_each} and
@code{copy} greatly helps.
@item
Use @code{glib::ustring} in place of @code{std::string} as
often as possible, to ensure Unicode support.
@item
If you need a smart pointer, be sure to check out
@code{glib::RefPtr<>}.
@end enumerate