@@ -74,7 +74,7 @@ class SafePtr
74
74
template <typename From> void init_ (const SafePtr<From>&) noexcept ;
75
75
76
76
// -------------------------------------------------------------------------------------------
77
- shared_ptr<T> pT_;
77
+ shared_ptr<T> pT_; // core
78
78
type_index realType_ = typeid (T); // origin type
79
79
type_index lastType_ = typeid (T); // maybe last valid type than realType_ & void
80
80
};
@@ -113,7 +113,7 @@ shared_ptr<To> SafePtr<T>::cast() const noexcept
113
113
// HID("(SafePtr) cast to derived");
114
114
return dynamic_pointer_cast<To>(pT_);
115
115
}
116
- else if constexpr (is_void_v<To>)
116
+ else if constexpr (is_void_v<To>)
117
117
{
118
118
// HID("(SafePtr) cast to void (for container to store diff types)");
119
119
return pT_;
@@ -152,7 +152,7 @@ void SafePtr<T>::init_(const SafePtr<From>& aSafeFrom) noexcept
152
152
153
153
realType_ = aSafeFrom.realType ();
154
154
// save last useful type
155
- if (type_index (typeid (T)) != realType_ && !is_same_v<T, void > )
155
+ if (!is_same_v<T, void > && type_index (typeid (T)) != realType_)
156
156
lastType_ = type_index (typeid (T));
157
157
else
158
158
lastType_ = aSafeFrom.lastType ();
@@ -205,16 +205,16 @@ bool operator<(SafePtr<T> lhs, SafePtr<U> rhs)
205
205
206
206
// ***********************************************************************************************
207
207
template <typename To, typename From>
208
- SafePtr<To> static_pointer_cast (const SafePtr<From>& aFromPtr ) noexcept
208
+ SafePtr<To> static_pointer_cast (const SafePtr<From>& aSafeFrom ) noexcept
209
209
{
210
- return dynamic_pointer_cast<To>(aFromPtr );
210
+ return dynamic_pointer_cast<To>(aSafeFrom );
211
211
}
212
212
} // namespace
213
213
214
214
template <typename T>
215
215
struct std ::hash<RLib::SafePtr<T>>
216
216
{
217
- auto operator ()(const RLib::SafePtr<T>& aSafeAdr ) const { return hash<shared_ptr<T>>()(aSafeAdr .get ()); }
217
+ auto operator ()(const RLib::SafePtr<T>& aSafePtr ) const { return hash<shared_ptr<T>>()(aSafePtr .get ()); }
218
218
};
219
219
220
220
// ***********************************************************************************************
0 commit comments