diff --git a/shared_ptr.htm b/shared_ptr.htm index 33db24b..3f6c7df 100644 --- a/shared_ptr.htm +++ b/shared_ptr.htm @@ -227,24 +227,28 @@ implementation.   The instantiation of member functions which require a complete type occurs in the shared_ptr_example2.cpp implementation file.

Frequently Asked Questions

-

Q. Why doesn't shared_ptr have template parameters supplying +

Q. Why doesn't shared_ptr have template parameters supplying traits or policies to allow extensive user customization?
-A. Parameterization discourages users.  Shared_ptr is +A. Parameterization discourages users.  Shared_ptr is carefully crafted to meet common needs without extensive parameterization. Someday a highly configurable smart pointer may be invented that is also very easy to use and very hard to misuse.  Until then, shared_ptr is the smart pointer of choice for a wide range of applications.  (Those interested in policy based smart pointers should read Modern C++ Design by Andrei Alexandrescu.)

-

Q. Why doesn't shared_ptr use a linked list implementation?
-A. A linked list implementation does not offer enough advantages to +

Q. Why doesn't shared_ptr use a linked list implementation?
+A. A linked list implementation does not offer enough advantages to offset the added cost of an extra pointer.  See timings page.

-

Q. Why don't shared_ptr (and the other Boost smart pointers) +

Q. Why don't shared_ptr (and the other Boost smart pointers) supply an automatic conversion to T*?
-A. Automatic conversion is believed to be too error prone.

+A. Automatic conversion is believed to be too error prone.

+

Q. Why does shared_ptr supply use_count()?
+A. As an aid to writing test cases and debugging displays. One of the +progenitors had use_count(), and it was useful in tracking down bugs in a +complex project that turned out to have cyclic-dependencies.


-

Revised 12 July, 2001 +

Revised 13 July, 2001

© Copyright Greg Colvin and Beman Dawes 1999. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright