Skip to content

Commit 24cc309

Browse files
authored
Marked copy operations as deleted for uncopiable types. (#2008)
* Marked copy operations as deleted for uncopiable types. * Lint
1 parent 8b1a9a5 commit 24cc309

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Pcap++/header/KniDevice.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ namespace pcpp
232232
private:
233233
/// All instances of this class MUST be produced by KniDeviceList class
234234
KniDevice(const KniDeviceConfiguration& conf, size_t mempoolSize, int unique);
235-
/// This class is not copyable
236-
KniDevice(const KniDevice&);
237-
/// This class is not copyable
238-
KniDevice& operator=(const KniDevice&);
235+
236+
KniDevice(const KniDevice&) = delete;
237+
KniDevice& operator=(const KniDevice&) = delete;
238+
239239
/// All instances of this class MUST be destroyed by KniDeviceList class
240240
~KniDevice();
241241

Pcap++/header/LinuxNicInformationSocket.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ namespace pcpp
2929
/// Tries to open handled socket on construction.
3030
/// If fails prints the debug message
3131
LinuxNicInformationSocket();
32+
33+
LinuxNicInformationSocket(const LinuxNicInformationSocket&) = delete;
34+
LinuxNicInformationSocket operator=(const LinuxNicInformationSocket&) = delete;
35+
3236
/// Closes handled socket on destruction.
3337
/// If no socket was opened prints the debug message
3438
~LinuxNicInformationSocket();
@@ -50,10 +54,6 @@ namespace pcpp
5054
bool makeRequest(const char* nicName, const IoctlType ioctlType, ifreq* request);
5155

5256
private:
53-
/// Hidden copy constructor. This structure is not copyable
54-
LinuxNicInformationSocket(const LinuxNicInformationSocket&);
55-
/// Hidden copy assignment operator. This structure is not copyable
56-
LinuxNicInformationSocket operator=(const LinuxNicInformationSocket&);
5757
LinuxSocket m_Socket;
5858
};
5959
} // namespace pcpp

0 commit comments

Comments
 (0)