Listing 6

// TR1 additions to header <memory>

namespace std {
 namespace tr1 {
    // SHARED POINTERS
template<class Ty> class shared_ptr;
template<class Ty1, class Ty2>
  bool operator==(const shared_ptr<Ty1>&, const shared_ptr<Ty2>&);
template<class Ty1, class Ty2>
  bool operator!=(const shared_ptr<Ty1>&, const shared_ptr<Ty2>&);
template<class Ty1, class Ty2>
  bool operator<(const shared_ptr<Ty1>&, const shared_ptr<Ty2>&);
template<class Elem, class Tr, class Ty>
  basic_ostream<Elem, Tr>& operator<<(
    basic_ostream<Elem, Tr>&, const shared_ptr<Ty>&);
template<class Ty>
  void swap(shared_ptr<Ty>&, shared_ptr<Ty>&);
template<class D, class Ty>
  D *get_deleter(const shared_ptr<Ty>&);
    // WEAK POINTERS
template<class Ty> class weak_ptr;
template<class Ty1, class Ty2>
  bool operator<(const weak_ptr<Ty1>&, const weak_ptr<Ty2>&);
template<class Ty>
  void swap(weak_ptr<Ty>&, weak_ptr<Ty>&);
    // UTILITY CLASSES AND TEMPLATES
template<class Ty> class enable_shared_from_this;
class bad_weak_ptr;
    // FUNCTIONS
template<class Ty, class Other>
  shared_ptr<Ty> const_pointer_cast(const shared_ptr<Other>&);
template<class Ty, class Other>
  shared_ptr<Ty> dynamic_pointer_cast(const shared_ptr<Other>&);
template<class Ty, class Other>
  shared_ptr<Ty> static_pointer_cast(const shared_ptr<Other>&);
} };