1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Delete operator=(Self&) when copy constructor is deleted (#8535)

This commit is contained in:
Paulo Cabral Sanz 2022-04-11 07:41:21 -03:00 committed by GitHub
parent 684156d211
commit 27827c8c6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -58,6 +58,7 @@ class PublicKey {
// Disable the copy constructor, we're pointer based // Disable the copy constructor, we're pointer based
PublicKey(const PublicKey& that) = delete; PublicKey(const PublicKey& that) = delete;
PublicKey& operator=(const PublicKey& that) = delete;
private: private:
brssl::public_key *_key; brssl::public_key *_key;
@ -86,6 +87,7 @@ class PrivateKey {
// Disable the copy constructor, we're pointer based // Disable the copy constructor, we're pointer based
PrivateKey(const PrivateKey& that) = delete; PrivateKey(const PrivateKey& that) = delete;
PrivateKey& operator=(const PrivateKey& that) = delete;
private: private:
brssl::private_key *_key; brssl::private_key *_key;
@ -122,6 +124,7 @@ class X509List {
// Disable the copy constructor, we're pointer based // Disable the copy constructor, we're pointer based
X509List(const X509List& that) = delete; X509List(const X509List& that) = delete;
X509List& operator=(const X509List& that) = delete;
private: private:
size_t _count; size_t _count;

View File

@ -34,7 +34,7 @@ namespace BearSSL {
class WiFiClientSecureCtx : public WiFiClient { class WiFiClientSecureCtx : public WiFiClient {
public: public:
WiFiClientSecureCtx(); WiFiClientSecureCtx();
WiFiClientSecureCtx(const WiFiClientSecure &rhs) = delete; WiFiClientSecureCtx(const WiFiClientSecureCtx &rhs) = delete;
~WiFiClientSecureCtx() override; ~WiFiClientSecureCtx() override;
WiFiClientSecureCtx& operator=(const WiFiClientSecureCtx&) = delete; WiFiClientSecureCtx& operator=(const WiFiClientSecureCtx&) = delete;
@ -43,7 +43,7 @@ class WiFiClientSecureCtx : public WiFiClient {
// TODO: don't remove just yet to avoid including the WiFiClient default implementation and unintentionally causing // TODO: don't remove just yet to avoid including the WiFiClient default implementation and unintentionally causing
// a 'slice' that this method tries to avoid in the first place // a 'slice' that this method tries to avoid in the first place
std::unique_ptr<WiFiClient> clone() const override { std::unique_ptr<WiFiClient> clone() const override {
return std::unique_ptr<WiFiClient>(new WiFiClientSecureCtx(*this)); return nullptr;
} }
int connect(IPAddress ip, uint16_t port) override; int connect(IPAddress ip, uint16_t port) override;