diff --git a/Pcap++/header/KniDevice.h b/Pcap++/header/KniDevice.h index 4af1dbb41..f1102f087 100644 --- a/Pcap++/header/KniDevice.h +++ b/Pcap++/header/KniDevice.h @@ -232,10 +232,10 @@ namespace pcpp private: /// All instances of this class MUST be produced by KniDeviceList class KniDevice(const KniDeviceConfiguration& conf, size_t mempoolSize, int unique); - /// This class is not copyable - KniDevice(const KniDevice&); - /// This class is not copyable - KniDevice& operator=(const KniDevice&); + + KniDevice(const KniDevice&) = delete; + KniDevice& operator=(const KniDevice&) = delete; + /// All instances of this class MUST be destroyed by KniDeviceList class ~KniDevice(); diff --git a/Pcap++/header/LinuxNicInformationSocket.h b/Pcap++/header/LinuxNicInformationSocket.h index 8d29e22f9..484f8b201 100644 --- a/Pcap++/header/LinuxNicInformationSocket.h +++ b/Pcap++/header/LinuxNicInformationSocket.h @@ -29,6 +29,10 @@ namespace pcpp /// Tries to open handled socket on construction. /// If fails prints the debug message LinuxNicInformationSocket(); + + LinuxNicInformationSocket(const LinuxNicInformationSocket&) = delete; + LinuxNicInformationSocket operator=(const LinuxNicInformationSocket&) = delete; + /// Closes handled socket on destruction. /// If no socket was opened prints the debug message ~LinuxNicInformationSocket(); @@ -50,10 +54,6 @@ namespace pcpp bool makeRequest(const char* nicName, const IoctlType ioctlType, ifreq* request); private: - /// Hidden copy constructor. This structure is not copyable - LinuxNicInformationSocket(const LinuxNicInformationSocket&); - /// Hidden copy assignment operator. This structure is not copyable - LinuxNicInformationSocket operator=(const LinuxNicInformationSocket&); LinuxSocket m_Socket; }; } // namespace pcpp