mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-03-19 19:35:17 +08:00
fix: correct typo smater_ptr to smart_ptr
Fix typo in smart pointer implementation class name
This commit is contained in:
@@ -33,12 +33,12 @@ private:
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class smater_ptr {
|
class smart_ptr {
|
||||||
public:
|
public:
|
||||||
explicit smater_ptr(
|
explicit smart_ptr(
|
||||||
T* ptr = nullptr)
|
T* ptr = nullptr)
|
||||||
: ptr_(ptr) {}
|
: ptr_(ptr) {}
|
||||||
~smater_ptr()
|
~smart_ptr()
|
||||||
{
|
{
|
||||||
delete ptr_;
|
delete ptr_;
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ private:
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class smater_ptr {
|
class smart_ptr {
|
||||||
public:
|
public:
|
||||||
...
|
...
|
||||||
T& operator*() const { return *ptr_; }
|
T& operator*() const { return *ptr_; }
|
||||||
|
|||||||
Reference in New Issue
Block a user