-#LyX 1.6.7 created this file. For more info see http://www.lyx.org/
+#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
-
\graphics default
\paperfontsize default
\spacing single
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
-\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\listings_params "basicstyle={\footnotesize}"
-\tracking_changes false
+\tracking_changes true
\output_changes false
-\author ""
-\author ""
+\author "Kornel Benko" Kornel.Benko@berlin.de
\end_header
\begin_body
for free.
For example, in our Stack implementation, almost everything we did was
needed to satisfy just the basic guarantee -- and what's presented above
- very nearly satisfies the strong guarantee, with little of no extra work.
+ very nearly satisfies the strong guarantee, with little o
+\change_inserted 0 1288157484
+r
+\change_deleted 0 1288157483
+f
+\change_unchanged
+ no extra work.
Not half bad, considering all the trouble we went to.
In addition to these two guarantees, there is one more guarantee that certain
functions must provide in order to make overall exception safety possible:
\begin_deeper
\begin_layout Itemize
+
+\change_inserted 0 1288159254
+\begin_inset CommandInset label
+LatexCommand label
+name "Use-string-wherever"
+
+\end_inset
+
+
+\change_unchanged
Use string wherever possible.
LyX will someday move to Unicode, and that will be easy if everybody uses
string now.
\end_layout
\begin_layout Standard
-I recently read an article by Scott Meyers in , where he makes a strong
- case on how non-member functions makes classes more encapsulated, not less.
+I recently read an article by Scott Meyers
+\change_deleted 0 1288158556
+ in
+\change_unchanged
+, where he makes a strong case on how non-member functions makes classes
+ more encapsulated, not less.
Just skipping to the core of this provides us with the following algorithm
for deciding what kind of function to add to a class interface:
\end_layout
write delete[] obj; if new obj[n]; was used to create the object and write
delete obj; if you wrote new obj; Notice strings should be std::string's
instead of char *'s.
+
+\change_inserted 0 1288159280
+ (this contradicts to
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Use-string-wherever"
+
+\end_inset
+
+ )
+\change_unchanged
+
\end_layout
\begin_layout Itemize
\begin_deeper
\begin_layout Itemize
-when swiching on enums, refrain from using "default:" if possible
+when swi
+\change_inserted 0 1288159389
+t
+\change_unchanged
+ching on enums, refrain from using "default:" if possible
\end_layout
\end_deeper