From 6436b019af89a7d86f6ea22a9b3413becf874ec7 Mon Sep 17 00:00:00 2001 From: Dimitar Krastev Date: Sun, 12 May 2024 10:13:29 +0300 Subject: [PATCH] Explicitly marks "deleted" copy ctors as deleted as in C++11 standard. --- Pcap++/header/PcapLiveDeviceList.h | 6 +++--- Pcap++/header/PcapRemoteDeviceList.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Pcap++/header/PcapLiveDeviceList.h b/Pcap++/header/PcapLiveDeviceList.h index 75ed7db6a2..93051cf946 100644 --- a/Pcap++/header/PcapLiveDeviceList.h +++ b/Pcap++/header/PcapLiveDeviceList.h @@ -32,9 +32,6 @@ namespace pcpp // private c'tor PcapLiveDeviceList(); - // private copy c'tor - PcapLiveDeviceList( const PcapLiveDeviceList& other ); - PcapLiveDeviceList& operator=(const PcapLiveDeviceList& other); void init(); @@ -42,6 +39,9 @@ namespace pcpp void updateLiveDeviceListView() const; public: + PcapLiveDeviceList(const PcapLiveDeviceList& other) = delete; + PcapLiveDeviceList& operator=(const PcapLiveDeviceList& other) = delete; + /* * @class SmartPtrApiTag * Helper tag to disambiguate smart pointer API. diff --git a/Pcap++/header/PcapRemoteDeviceList.h b/Pcap++/header/PcapRemoteDeviceList.h index e4300785cb..acac862032 100644 --- a/Pcap++/header/PcapRemoteDeviceList.h +++ b/Pcap++/header/PcapRemoteDeviceList.h @@ -37,15 +37,15 @@ namespace pcpp // private c'tor. User should create the list via static methods PcapRemoteDeviceList::getRemoteDeviceList() PcapRemoteDeviceList(const IPAddress& ipAddress, uint16_t port, std::shared_ptr remoteAuth, std::vector> deviceList); - // private copy c'tor - PcapRemoteDeviceList(const PcapRemoteDeviceList& other); - PcapRemoteDeviceList& operator=(const PcapRemoteDeviceList& other); void updateDeviceListView(); // Implementation that uses a shared ptr is private to guarantee that the remote auth object is not shared externally. It is used by the other overloads. static std::unique_ptr getRemoteDeviceList(const IPAddress& ipAddress, uint16_t port, std::shared_ptr remoteAuth); public: + PcapRemoteDeviceList(const PcapRemoteDeviceList& other) = delete; + PcapRemoteDeviceList& operator=(const PcapRemoteDeviceList& other) = delete; + /** * Iterator object that can be used for iterating all PcapRemoteDevice in list */