アットウィキロゴ

boost > smart_ptr

すべてのスマートポインタを利用可能にするヘッダ。
#include <boost/shared_ptr.hpp>

boost::shared_ptr<T>

#include <boost/shared_ptr.hpp>
  1. namespace boost{
  2. template<class T> class shared_ptr{
  3. public:
  4.  
  5. typedef T element_type;
  6. typedef T value_type;
  7. typedef T * pointer;
  8. typedef typename boost::detail::shared_ptr_traits<T>::reference reference;
  9.  
  10. shared_ptr();
  11.  
  12. template<class Y>
  13. explicit shared_ptr(Y * p);
  14. template<class Y, class D> shared_ptr(Y * p, D d);
  15. template<class Y, class D, class A> shared_ptr(Y * p, D d, A a);
  16. shared_ptr & operator=(shared_ptr const & r);
  17. template<class Y> explicit shared_ptr(weak_ptr<Y> const & r);
  18. template<class Y> shared_ptr(shared_ptr<Y> const & r );
  19. template<class Y> shared_ptr(shared_ptr<Y> const & r, T * p )
  20. template<class Y> explicit shared_ptr(std::auto_ptr<Y> & r);
  21. template<class Y> shared_ptr & operator=(shared_ptr<Y> const & r);
  22. template<class Y> shared_ptr & operator=(std::auto_ptr<Y> & r);
  23. shared_ptr(shared_ptr && r);
  24. template<class Y> shared_ptr(shared_ptr<Y> && r);
  25. shared_ptr & operator= (shared_ptr && r);
  26. template<class Y> shared_ptr & operator=(shared_ptr<Y> && r);
  27.  
  28. void reset();
  29. template<class Y> void reset(Y * p);
  30. template<class Y, class D> void reset(Y * p, D d);
  31. template<class Y, class D, class A> void reset(Y * p, D d, A a);
  32. template<class Y> void reset(shared_ptr<Y> const & r, T * p);
  33.  
  34. reference operator* () const;
  35. T * operator-> () const;
  36. T * get() const;
  37. operator bool () const;
  38. bool operator! () const;
  39. bool unique() const;
  40. long use_count() const;
  41. void swap(shared_ptr<T> & other);
  42. }; // shared_ptr
  43.  
  44.  
  45. template<class T, class U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b);
  46. template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<U> const & b);
  47. template<class T> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<T> const & b);
  48. template<class T, class U> inline bool operator<(shared_ptr<T> const & a, shared_ptr<U> const & b);
  49. template<class T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b);
  50. template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r);
  51. template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r);
  52. template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r);
  53. template<class T, class U> shared_ptr<T> shared_static_cast(shared_ptr<U> const & r);
  54. template<class T, class U> shared_ptr<T> shared_dynamic_cast(shared_ptr<U> const & r);
  55. template<class T, class U> shared_ptr<T> shared_polymorphic_cast(shared_ptr<U> const & r);
  56. template<class T, class U> shared_ptr<T> shared_polymorphic_downcast(shared_ptr<U> const & r);
  57. template<class T> inline T * get_pointer(shared_ptr<T> const & p);
  58. template<class D, class T> D * get_deleter(shared_ptr<T> const & p);
  59.  
  60. } // namespace boost
  61.  
  62.  

boost::shared_array<>

#include <boostr/shared_array.hpp>

boost::weak_ptr<>

#include <boostr/weak_ptr.hpp>

boost::scoped_ptr<>

#include <boostr/scoped_ptr.hpp>

boost::scoped_array<>

#include <boostr/scoped_array.hpp>

boost::intrusive_ptr<>

#include <boostr/intrusive_ptr.hpp>
最終更新:2009年03月22日 13:42