From 7f8760539cb93768bb845e74daea7982844f712b Mon Sep 17 00:00:00 2001 From: tchernobog Date: Tue, 24 Jan 2006 21:48:52 +0000 Subject: [PATCH] - 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 --- doc/sgpem2dman.texi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/sgpem2dman.texi b/doc/sgpem2dman.texi index d05507c..95257ee 100644 --- a/doc/sgpem2dman.texi +++ b/doc/sgpem2dman.texi @@ -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