diff --git a/doc/guidelines.html b/doc/guidelines.html index fbb2147..9ca07eb 100644 --- a/doc/guidelines.html +++ b/doc/guidelines.html @@ -290,6 +290,8 @@ ul.auto-toc {
Pointer Container LibraryThe recommended usage pattern of the container classes are the same as the for normal standard containers.
ptr_vector, ptr_list and ptr_deque offer the programmer different @@ -306,6 +308,60 @@ one element for each key. Otherwise, it supports equivalent keys. ptr_set and ptr_map support unique keys. ptr_multiset and ptr_multimap support equivalent keys.
+Idiomtic Object-Oriented Programming in C++ looks a bit different from +the way it is done in other languages. This is partly because C++ +has both value and reference semantics, and partly because C++ is more flexible +than other languages. Below is a list of recommendations that you are +encouraged to follow:
+The has the following advantages:
++++
+ +- It reduces coupling because you do not have to maintain or update state
++
+ +- It helps you to avoid slicing
++
+- It ensures you override the right function
+
You might also want to read the following articles:
+This has the following advantages:
++++
+ +- It makes sure all calls to the virtual function always goes through one place in your code
++
+- It enables you to check preconditions and postconditions inside the forwarding function
+
You might also want to read Herb Sutter's article Virtuality.
+Having an abstact base class prevents slicing when the base class is involved, but +it does not prevent it for classes further down the hierarchy. This is where +boost::noncopyable is handy to use.
+Navigate: