28 explicit ref<T>(
const std::shared_ptr<T> & p)
32 throw std::invalid_argument(
"null pointer cast to ref");
39 throw std::invalid_argument(
"null pointer cast to ref");
42 T* operator ->()
const
52 operator std::shared_ptr<T> ()
const
57 std::shared_ptr<T> get_ptr()
const
65 return ref<T2>(std::dynamic_pointer_cast<T2>(p));
69 std::shared_ptr<T2> dynamic_pointer_cast()
const
71 return std::dynamic_pointer_cast<T2>(p);
77 return ref<T2>((std::shared_ptr<T2>) p);
82 bool operator == (
const ref<T> & other)
const
87 bool operator != (
const ref<T> & other)
const
92 bool operator < (
const ref<T> & other)
const
99 template<
typename T2,
typename...
Args>
101 make_ref(
Args&&... args);