(Click here for a personal note from Marshall Cline.)
C++ FAQ
/
Section 4
/ FAQ 4.24
Section 4:
4.1
Updates for the 03/12 release?
New!
4.2
Updates for the 11/11 release?
New!
4.3
Updates for the 07/11 release?
4.4
Updates for the 05/11 release?
4.5
Updates for the 03/11 release?
4.6
Updates for the 08/10 release?
4.7
Updates for the 06/10 release?
4.8
Updates for the 05/10 release?
4.9
Updates for the 04/10 release?
4.10
Updates for the 03/10 release?
4.11
Updates for the 01/10 release?
4.12
Updates for the 09/09 release?
4.13
Updates for the 06/09 release?
4.14
Updates for the 01/09 release?
4.15
Updates for the 03/07 release?
4.16
Updates for the 09/06 release?
4.17
Updates for the 03/06 release?
4.18
Updates for the 10/05 release?
4.19
Updates for the 07/05 release?
4.20
Updates for the 06/05 release?
4.21
Updates for the 05/05 release?
4.22
Updates for the 04/05 release?
4.23
Updates for the 03/05 release?
4.24
Updates for the 02/05 release?
4.25
Updates for the 12/04 release?
4.26
Updates for the 06/04 release?
4.27
Updates for the 08/03 release?
4.28
Updates for the 06/03 release?
4.29
Updates for the 05/03 release?
4.30
Updates for the 04/03 release?
4.31
Updates for the 03/03 release?
4.32
Updates for the 02/03 release?
4.33
Updates for the 01/03 release?
4.34
Updates for the 12/02 release?
4.35
Updates for the 09/02 release?
4.36
Updates for the 06/02 release?
4.37
Updates for the 05/02 release?
4.38
Updates for the 04/02 release?
4.39
Updates for the 03/02 release?
4.40
Updates for the 08/01 release?
4.41
Updates for the 04/01 release?
4.42
Updates for the 07/00 release?
4.43
Updates for the 03/00 release?
4.44
Updates for the 01/00 release?
4.45
Updates for the 10/99 release?
4.46
Updates for the 07/99 release?
4.47
Updates for the 06/98 release?
4.48
Updates for the 05/98 release?
4.49
Updates for the 09/97 release?
4.50
Updates for the 01/97 release?
4.51
Updates for the 11/96 release?
4.52
Updates for the 10/96 release?
4.53
Updates for the 09/96 release?
4.54
Updates for the 08/96 release?
4.55
Updates for the 07/96 release?
4.56
Updates for the 06/96 release?
4.57
Updates for the 05/96 release?
4.58
Updates for the 04/96 release?
4.59
Updates for the 03/96 release?
4.60
Updates for the 09/95 release?
4.61
Updates for the 06/95 release?
4.62
Updates for the 04/95 release?
4.63
Updates for the 03/95 release?
4.64
Updates for the 01/95 release?
4.65
Updates for the 12/94 release?
4.66
Updates for the 11/94 release?
4.67
Updates for the 08/94 release?
4.68
Updates for the 08/94 release?
[4.24] What updates were made for the 02/05 release?
Generic changes:
Split the section on Containers and Templates into a
section on Containers
and a
section on Templates
.
6 New FAQs:
[4.24] What updates were made for the 02/05 release?
(created)
[9.9] With inline member functions that are defined outside the class, is it best to put the
inline
keyword next to the declaration within the class body, next to the definition outside the class body, or both?
(created)
[10.9] Does return-by-value mean extra copies and extra overhead?
(created)
[13.8] Okay, that tells me the operators I
can
override; which operators
should
I override?
(created thanks to
Conrad Weisert
for suggesting the topic)
[13.9] What are some guidelines / "rules of thumb" for overloading operators?
(created)
[33.14] Can you make functionoids faster than normal function calls?
(created thanks to a suggestion from
Padmanabhan V. Karthic
)
24 Changed FAQs:
[5.9] Which newsgroup should I post my questions?
(added a link to TechiWarehouse thanks to
Adam Fisher
)
[9.3] Do
inline
functions improve performance?
(added two bullets on cache misses thanks to a suggestion from
Tom Brown
)
[10.6] Should my constructors use "initialization lists" or "assignment"?
(added an "or when" and a cross reference to the last paragraph, plus fixed some grammar, thanks to
Padmanabhan V. Karthic
)
[10.8] What is the "Named Constructor Idiom"?
(added the last paragraph to discuss the return-by-value optimization thanks to a question from
Can Isin
)
[10.20] What is the "Named Parameter Idiom"?
(changed
friend File;
to
friend class File;
thanks to
Mehri
and
Padmanabhan V. Karthic
)
[10.21] Why am I getting an error after declaring a
Foo
object via
Foo x(Bar())
?
(added the alternate syntax
Foo x = Bar();
thanks to a suggestion from
Mike Dunn
)
[13.13] Should I design my classes from the outside (interfaces first) or from the inside (data first)?
(changed
friend LinkedList;
to
friend class LinkedList;
, and similarly with
LinkedListIterator
, thanks to
Padmanabhan V. Karthic
)
[16.19] What's another way to build a
Matrix
template?
(added some pros/cons (mostly pros) thanks to a suggestion from
Padmanabhan V. Karthic
)
[16.22] How do I do simple reference counting?
(changed
friend FredPtr;
to
friend class FredPtr;
thanks to
Padmanabhan V. Karthic
)
[16.24] How do I provide reference counting with copy-on-write semantics for a hierarchy of classes?
(changed
friend Fred;
to
friend class Fred;
thanks to
Padmanabhan V. Karthic
)
[17.6] Exception handling seems to make my life more difficult; clearly
I'm
not the problem, am I??
(rewrote the last bullet thanks to a critique of the old wording from
Jan Ploski
)
[17.13] What should I catch?
(fixed a grammatical error thanks to
Padmanabhan V. Karthic
)
[18.15] Why does the compiler allow me to change an
int
after I've pointed at it with a
int const*
?
(initialized variable
x
in
main()
thanks to
Yechiel Kimchi
)
[27.13] Are there any other sources of coding standards?
(hoisted the Sutter/Alexandrescu book out to its proper, primary place; also added (thanks to
Kevlin Henney
) links to and insights about Elemtel and Industrial Strength C++)
[29.5] What are the criteria for choosing between
short
/
int
/
long
data types?
(added the disclaimer that
<stdint.h>
is not part of the C++ standard and might not be supplied by your compiler vendor thanks to
Padmanabhan V. Karthic
)
[29.19] What is the type of an enumeration such as
enum Color
? Is it of type
int
?
(fixed a typo thanks to
Surendra Phadke
and
Brandon Forehand
)
[30.5] What are the practical consequences of differences in Smalltalk/C++ inheritance?
(fixed the spelling of Maserati thanks to
Alessandro/Gruppo Visione
)
[33.2] How do I pass a pointer-to-member-function to a signal handler, X event callback, system call that starts a thread/task, etc?
(fixed a grammatical error thanks to
Padmanabhan V. Karthic
)
[33.5] How can I avoid syntax errors when creating pointers to members?
(added return value (
int ans = ...
) to make the sample-code more illustrative thanks to
Pete Brunet
)
[33.6] How can I avoid syntax errors when calling a member function using a pointer-to-member-function?
(added return value (
int ans = ...
) to make the sample-code more illustrative thanks to
Pete Brunet
)
[33.13] What the heck is a functionoid, and why would I use one?
(added a virtual dtor thanks to
Marcus
; added parameters to
doit()
thanks to
Dirk Bonekaemper
; made the dtor pure virtual as an optimization)
[35.19] Why am I getting errors when my template-derived-class uses a member it inherits from its template-base-class?
(added
public:
thanks to
Alexander Kamotsky
and
Leonard "SoulSkorpion" Frankel
and
Stefan Näwe
; fixed a grammatical error thanks to
Val Kartchner
)
[39.4] What should be done with macros that contain
if
?
(clarified why we use the
(void)0
part thanks to a suggestion from
Padmanabhan V. Karthic
)
[40.1] How can I generate HTML documentation for my classes? Does C++ have anything similar to
javadoc
?
(updated the link to
www.robertnz.net/cpp_site.html
thanks to
Robert Davies
and
Peter Kammer
)