Skip to content

Commit 27ac18d

Browse files
committed
clean
1 parent b46ba3e commit 27ac18d

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

section5/SalesData.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ class SalesData final
5757
SalesData() = default;
5858
~SalesData() = default;
5959

60-
SalesData(const SalesData&) = default;
61-
SalesData& operator=(const SalesData&) = default;
60+
SalesData(const this_type&) = default;
61+
SalesData& operator=(const this_type&) = default;
6262

63-
SalesData(SalesData&& s) = default;
64-
SalesData& operator=(SalesData&& s) = default;
63+
SalesData(this_type&& s) = default;
64+
SalesData& operator=(this_type&& s) = default;
6565

6666
private:
6767
string_type m_id = "";

section5/SpinLock.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ BEGIN_NAMESPACE(cpp_study)
1111
class SpinLock final
1212
{
1313
public:
14+
using this_type = SpinLock;
1415
using atomic_type = std::atomic_flag;
1516

1617
public:
1718
SpinLock() = default;
1819
~SpinLock() = default;
1920

20-
SpinLock(const SpinLock&) = delete;
21-
SpinLock& operator=(const SpinLock&) = delete;
21+
SpinLock(const this_type&) = delete;
22+
SpinLock& operator=(const this_type&) = delete;
2223
public:
2324
void lock() noexcept
2425
{
@@ -49,6 +50,7 @@ class SpinLock final
4950
class SpinLockGuard final
5051
{
5152
public:
53+
using this_type = SpinLockGuard;
5254
using spin_lock_type = SpinLock;
5355
public:
5456
SpinLockGuard(spin_lock_type& lock) noexcept
@@ -63,8 +65,8 @@ class SpinLockGuard final
6365
}
6466

6567
public:
66-
SpinLockGuard(const SpinLockGuard&) = delete;
67-
SpinLockGuard& operator=(const SpinLockGuard&) = delete;
68+
SpinLockGuard(const this_type&) = delete;
69+
SpinLockGuard& operator=(const this_type&) = delete;
6870
private:
6971
spin_lock_type& m_lock;
7072
};

section5/Summary.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Summary final
2828
Summary() = default;
2929
~Summary() = default;
3030

31-
Summary(const Summary&) = delete;
32-
Summary& operator=(const Summary&) = delete;
31+
Summary(const this_type&) = delete;
32+
Summary& operator=(const this_type&) = delete;
3333
private:
3434
mutable lock_type m_lock;
3535
map_type m_sales;

section5/Zmq.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class ZmqContext final
2323
using zmq_socket_type = zmq::socket_t;
2424
using zmq_message_type = zmq::message_t;
2525
#endif
26+
public:
27+
ZmqContext() = default;
28+
~ZmqContext() = default;
2629
public:
2730
static
2831
zmq_context_type& context()

0 commit comments

Comments
 (0)