cpp: Expliticly declare compiler generated copy constructors

* lang/cpp/src/configuration.h (Component, Option),
lang/cpp/src/data.h (Data),
lang/cpp/src/decryptionresult.h (DecryptionResult,
DecryptionResult::Recipient),
lang/cpp/src/encryptionresult.h (EncryptionResult, InvalidRecipient),
lang/cpp/src/engineinfo.h (EngineInfo),
lang/cpp/src/importresult.h (ImportResult, Import),
lang/cpp/src/key.h (Key, Subkey, UserID, UserID::Signature),
lang/cpp/src/keygenerationresult.h (KeyGenerationResult),
lang/cpp/src/keylistresult.h (KeyListResult),
lang/cpp/src/notation.h (Notation),
lang/cpp/src/signingresult.h (SigningResult, InvalidSigningKey,
CreatedSignature),
lang/cpp/src/swdbresult.h (SwdbResult),
lang/cpp/src/tofuinfo.h (TofuInfo),
lang/cpp/src/verificationresult.h (VerificationResult, Signature),
lang/cpp/src/vfsmountresult.h (VfsMountResult): Explitily declare
compiler generated copy constructor.
--

This fixes "implicitly-declared copy constructor is deprecated"
warnings.
This commit is contained in:
Ingo Klöcker 2023-01-05 20:17:57 +01:00
parent e16c368758
commit dc9cc9aa07
No known key found for this signature in database
GPG Key ID: F5A5D1692277A1E9
15 changed files with 25 additions and 2 deletions

View File

@ -98,8 +98,7 @@ public:
explicit Component(const shared_gpgme_conf_comp_t &gpgme_comp) explicit Component(const shared_gpgme_conf_comp_t &gpgme_comp)
: comp(gpgme_comp) {} : comp(gpgme_comp) {}
// copy ctor is ok Component(const Component &other) = default;
const Component &operator=(const Component &other) const Component &operator=(const Component &other)
{ {
if (this != &other) { if (this != &other) {
@ -149,6 +148,7 @@ public:
Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt) Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt)
: comp(gpgme_comp), opt(gpgme_opt) {} : comp(gpgme_comp), opt(gpgme_opt) {}
Option(const Option &other) = default;
const Option &operator=(const Option &other) const Option &operator=(const Option &other)
{ {
if (this != &other) { if (this != &other) {

View File

@ -60,6 +60,7 @@ public:
static const Null null; static const Null null;
Data(const Data &other) = default;
const Data &operator=(Data other) const Data &operator=(Data other)
{ {
swap(other); swap(other);

View File

@ -47,6 +47,7 @@ public:
DecryptionResult(gpgme_ctx_t ctx, const Error &err); DecryptionResult(gpgme_ctx_t ctx, const Error &err);
explicit DecryptionResult(const Error &err); explicit DecryptionResult(const Error &err);
DecryptionResult(const DecryptionResult &other) = default;
const DecryptionResult &operator=(DecryptionResult other) const DecryptionResult &operator=(DecryptionResult other)
{ {
swap(other); swap(other);
@ -103,6 +104,7 @@ public:
Recipient(); Recipient();
explicit Recipient(gpgme_recipient_t reci); explicit Recipient(gpgme_recipient_t reci);
Recipient(const Recipient &other) = default;
const Recipient &operator=(Recipient other) const Recipient &operator=(Recipient other)
{ {
swap(other); swap(other);

View File

@ -48,6 +48,7 @@ public:
EncryptionResult(gpgme_ctx_t ctx, const Error &error); EncryptionResult(gpgme_ctx_t ctx, const Error &error);
EncryptionResult(const Error &err); EncryptionResult(const Error &err);
EncryptionResult(const EncryptionResult &other) = default;
const EncryptionResult &operator=(EncryptionResult other) const EncryptionResult &operator=(EncryptionResult other)
{ {
swap(other); swap(other);
@ -83,6 +84,7 @@ class GPGMEPP_EXPORT InvalidRecipient
public: public:
InvalidRecipient(); InvalidRecipient();
InvalidRecipient(const InvalidRecipient &other) = default;
const InvalidRecipient &operator=(InvalidRecipient other) const InvalidRecipient &operator=(InvalidRecipient other)
{ {
swap(other); swap(other);

View File

@ -151,6 +151,7 @@ public:
EngineInfo(); EngineInfo();
explicit EngineInfo(gpgme_engine_info_t engine); explicit EngineInfo(gpgme_engine_info_t engine);
EngineInfo(const EngineInfo &other) = default;
const EngineInfo &operator=(EngineInfo other) const EngineInfo &operator=(EngineInfo other)
{ {
swap(other); swap(other);

View File

@ -47,6 +47,7 @@ public:
ImportResult(gpgme_ctx_t ctx, const Error &error); ImportResult(gpgme_ctx_t ctx, const Error &error);
explicit ImportResult(const Error &error); explicit ImportResult(const Error &error);
ImportResult(const ImportResult &other) = default;
const ImportResult &operator=(ImportResult other) const ImportResult &operator=(ImportResult other)
{ {
swap(other); swap(other);
@ -106,6 +107,7 @@ class GPGMEPP_EXPORT Import
public: public:
Import(); Import();
Import(const Import &other) = default;
const Import &operator=(Import other) const Import &operator=(Import other)
{ {
swap(other); swap(other);

View File

@ -71,6 +71,7 @@ public:
static const Null null; static const Null null;
Key(const Key &other) = default;
const Key &operator=(Key other) const Key &operator=(Key other)
{ {
swap(other); swap(other);
@ -228,6 +229,7 @@ public:
Subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey); Subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey);
Subkey(const shared_gpgme_key_t &key, unsigned int idx); Subkey(const shared_gpgme_key_t &key, unsigned int idx);
Subkey(const Subkey &other) = default;
const Subkey &operator=(Subkey other) const Subkey &operator=(Subkey other)
{ {
swap(other); swap(other);
@ -341,6 +343,7 @@ public:
UserID(const shared_gpgme_key_t &key, gpgme_user_id_t uid); UserID(const shared_gpgme_key_t &key, gpgme_user_id_t uid);
UserID(const shared_gpgme_key_t &key, unsigned int idx); UserID(const shared_gpgme_key_t &key, unsigned int idx);
UserID(const UserID &other) = default;
const UserID &operator=(UserID other) const UserID &operator=(UserID other)
{ {
swap(other); swap(other);
@ -459,6 +462,7 @@ public:
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, gpgme_key_sig_t sig); Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, gpgme_key_sig_t sig);
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, unsigned int idx); Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, unsigned int idx);
Signature(const Signature &other) = default;
const Signature &operator=(Signature other) const Signature &operator=(Signature other)
{ {
swap(other); swap(other);

View File

@ -44,6 +44,7 @@ public:
KeyGenerationResult(gpgme_ctx_t ctx, const Error &error); KeyGenerationResult(gpgme_ctx_t ctx, const Error &error);
explicit KeyGenerationResult(const Error &err); explicit KeyGenerationResult(const Error &err);
KeyGenerationResult(const KeyGenerationResult &other) = default;
const KeyGenerationResult &operator=(KeyGenerationResult other) const KeyGenerationResult &operator=(KeyGenerationResult other)
{ {
swap(other); swap(other);

View File

@ -45,6 +45,7 @@ public:
explicit KeyListResult(const Error &err); explicit KeyListResult(const Error &err);
KeyListResult(const Error &err, const _gpgme_op_keylist_result &res); KeyListResult(const Error &err, const _gpgme_op_keylist_result &res);
KeyListResult(const KeyListResult &other) = default;
const KeyListResult &operator=(KeyListResult other) const KeyListResult &operator=(KeyListResult other)
{ {
swap(other); swap(other);

View File

@ -44,6 +44,7 @@ public:
Notation(); Notation();
explicit Notation(gpgme_sig_notation_t nota); explicit Notation(gpgme_sig_notation_t nota);
Notation(const Notation &other) = default;
const Notation &operator=(Notation other) const Notation &operator=(Notation other)
{ {
swap(other); swap(other);

View File

@ -50,6 +50,7 @@ public:
SigningResult(gpgme_ctx_t ctx, const Error &error); SigningResult(gpgme_ctx_t ctx, const Error &error);
explicit SigningResult(const Error &err); explicit SigningResult(const Error &err);
SigningResult(const SigningResult &other) = default;
const SigningResult &operator=(SigningResult other) const SigningResult &operator=(SigningResult other)
{ {
swap(other); swap(other);
@ -86,6 +87,7 @@ class GPGMEPP_EXPORT InvalidSigningKey
public: public:
InvalidSigningKey(); InvalidSigningKey();
InvalidSigningKey(const InvalidSigningKey &other) = default;
const InvalidSigningKey &operator=(InvalidSigningKey other) const InvalidSigningKey &operator=(InvalidSigningKey other)
{ {
swap(other); swap(other);
@ -119,6 +121,7 @@ public:
CreatedSignature(); CreatedSignature();
CreatedSignature(const CreatedSignature &other) = default;
const CreatedSignature &operator=(CreatedSignature other) const CreatedSignature &operator=(CreatedSignature other)
{ {
swap(other); swap(other);

View File

@ -62,6 +62,7 @@ public:
const char *iversion = NULL, const char *iversion = NULL,
Error *err = NULL); Error *err = NULL);
SwdbResult(const SwdbResult &other) = default;
const SwdbResult &operator=(SwdbResult other) const SwdbResult &operator=(SwdbResult other)
{ {
swap(other); swap(other);

View File

@ -39,6 +39,7 @@ public:
TofuInfo(); TofuInfo();
explicit TofuInfo(gpgme_tofu_info_t info); explicit TofuInfo(gpgme_tofu_info_t info);
TofuInfo(const TofuInfo &other) = default;
const TofuInfo &operator=(TofuInfo other) const TofuInfo &operator=(TofuInfo other)
{ {
swap(other); swap(other);

View File

@ -52,6 +52,7 @@ public:
VerificationResult(gpgme_ctx_t ctx, const Error &error); VerificationResult(gpgme_ctx_t ctx, const Error &error);
explicit VerificationResult(const Error &err); explicit VerificationResult(const Error &err);
VerificationResult(const VerificationResult &other) = default;
const VerificationResult &operator=(VerificationResult other) const VerificationResult &operator=(VerificationResult other)
{ {
swap(other); swap(other);
@ -90,6 +91,7 @@ public:
Signature(); Signature();
Signature(const Signature &other) = default;
const Signature &operator=(Signature other) const Signature &operator=(Signature other)
{ {
swap(other); swap(other);

View File

@ -45,6 +45,7 @@ public:
VfsMountResult(gpgme_ctx_t ctx, const Error &error, const Error &opError); VfsMountResult(gpgme_ctx_t ctx, const Error &error, const Error &opError);
explicit VfsMountResult(const Error &err); explicit VfsMountResult(const Error &err);
VfsMountResult(const VfsMountResult &other) = default;
const VfsMountResult &operator=(VfsMountResult other) const VfsMountResult &operator=(VfsMountResult other)
{ {
swap(other); swap(other);