Skip to content

Commit a7e5480

Browse files
committed
SafePtr: class->typename
1 parent 29e3c4e commit a7e5480

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/safe_mem/SafePtr.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ using namespace std;
3030
namespace RLib
3131
{
3232
// ***********************************************************************************************
33-
template<class T = void> class SafePtr
33+
template<typename T = void> class SafePtr
3434
{
3535
public:
3636
// create
37-
template<class U, class... Args> friend SafePtr<U> make_safe(Args&&... aArgs);
37+
template<typename U, typename... Args> friend SafePtr<U> make_safe(Args&&... aArgs);
3838
SafePtr() = default;
3939

4040
// any <-> void
41-
template<class From> SafePtr(const SafePtr<From>&);
41+
template<typename From> SafePtr(const SafePtr<From>&);
4242

4343
template<typename To> shared_ptr<To> get() const;
4444
shared_ptr<void> get() const;
@@ -54,8 +54,8 @@ template<class T = void> class SafePtr
5454
};
5555

5656
// ***********************************************************************************************
57-
template<class T>
58-
template<class From>
57+
template<typename T>
58+
template<typename From>
5959
SafePtr<T>::SafePtr(const SafePtr<From>& aSafeFrom)
6060
: pT_(aSafeFrom.template get<T>())
6161
{
@@ -79,8 +79,8 @@ SafePtr<T>::SafePtr(const SafePtr<From>& aSafeFrom)
7979
}
8080

8181
// ***********************************************************************************************
82-
template<class T>
83-
template<class To>
82+
template<typename T>
83+
template<typename To>
8484
shared_ptr<To> SafePtr<T>::get() const
8585
{
8686
if (is_convertible<T*, To*>::value)
@@ -95,22 +95,22 @@ shared_ptr<To> SafePtr<T>::get() const
9595
}
9696
return nullptr;
9797
}
98-
template<class T>
98+
template<typename T>
9999
shared_ptr<void> SafePtr<T>::get() const
100100
{
101101
HID("(SafePtr) any to void (for container to store diff types)");
102102
return pT_;
103103
}
104104
template<>
105-
template<class To>
105+
template<typename To>
106106
shared_ptr<To> SafePtr<void>::get() const
107107
{
108108
HID("(SafePtr) back from void");
109109
return static_pointer_cast<To>(pT_);
110110
}
111111

112112
// ***********************************************************************************************
113-
template<class U, class... Args> SafePtr<U> make_safe(Args&&... aArgs)
113+
template<typename U, typename... Args> SafePtr<U> make_safe(Args&&... aArgs)
114114
{
115115
SafePtr<U> sptr;
116116
sptr.pT_ = make_shared<U>(forward<Args>(aArgs)...);

0 commit comments

Comments
 (0)