21 explicit ref(
const std::shared_ptr<T> & p)
25 throw std::invalid_argument(
"null pointer cast to ref");
32 throw std::invalid_argument(
"null pointer cast to ref");
35 T* operator ->()
const
45 operator std::shared_ptr<T> ()
const
50 std::shared_ptr<T> get_ptr()
const
58 return ref<T2>(std::dynamic_pointer_cast<T2>(p));
62 std::shared_ptr<T2> dynamic_pointer_cast()
const
64 return std::dynamic_pointer_cast<T2>(p);
68 operator ref<T2> ()
const
70 return ref<T2>((std::shared_ptr<T2>) p);
73 bool operator == (
const ref<T> & other)
const
78 bool operator != (
const ref<T> & other)
const
83 auto operator <=> (
const ref<T> & other)
const
90 template<
typename T2,
typename...
Args>