@@ -38,27 +38,7 @@ template<class T> class SafePtr
38
38
SafePtr () = default ;
39
39
40
40
// any <-> void
41
- template <class From > SafePtr (const SafePtr<From>& aSafeFrom)
42
- : pT_(aSafeFrom.template get<T>())
43
- {
44
- HID (typeid (From).name () << " to " << typeid (T).name ());
45
- if (! pT_)
46
- {
47
- HID (" pT_ == nullptr" ); // HID: ut debug only
48
- return ;
49
- }
50
- realType_ = aSafeFrom.realType ();
51
- if (! is_same<T, void >::value)
52
- {
53
- HID (" not to void" );
54
- return ;
55
- }
56
- if (! is_same<From, void >::value)
57
- {
58
- HID (" not from void" );
59
- preVoidType_ = &typeid (From);
60
- }
61
- }
41
+ template <class From > SafePtr (const SafePtr<From>&);
62
42
63
43
template <typename To> shared_ptr<To> get () const ;
64
44
shared_ptr<void > get () const ;
@@ -73,6 +53,31 @@ template<class T> class SafePtr
73
53
const type_info* realType_ = &typeid (T); // that pT_ point to, can safely cast to
74
54
};
75
55
56
+ // ***********************************************************************************************
57
+ template <class T >
58
+ template <class From >
59
+ SafePtr<T>::SafePtr(const SafePtr<From>& aSafeFrom)
60
+ : pT_(aSafeFrom.template get<T>())
61
+ {
62
+ HID (typeid (From).name () << " to " << typeid (T).name ());
63
+ if (! pT_)
64
+ {
65
+ HID (" pT_ == nullptr" ); // HID: ut debug only
66
+ return ;
67
+ }
68
+ realType_ = aSafeFrom.realType ();
69
+ if (! is_same<T, void >::value)
70
+ {
71
+ HID (" not to void" );
72
+ return ;
73
+ }
74
+ if (! is_same<From, void >::value)
75
+ {
76
+ HID (" not from void" );
77
+ preVoidType_ = &typeid (From);
78
+ }
79
+ }
80
+
76
81
// ***********************************************************************************************
77
82
template <class T >
78
83
template <class To >
0 commit comments