Fix gcc warnings from having only one of assignment/copy
For example: warning: implicitly-declared ‘constexpr Complex& Complex::operator=(const Complex&)’ is deprecated [-Wdeprecated-copy] Pick-to: 6.1 Change-Id: I7598e821acb7cb7bf17776d693af62778185afc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
fa3b672f99
commit
ed8429495e
@ -1618,6 +1618,8 @@ public:
|
||||
{ currentInstanceCount.fetchAndAddRelaxed(-1);}
|
||||
inline InstanceCounter(const InstanceCounter &)
|
||||
{ currentInstanceCount.fetchAndAddRelaxed(1); updatePeak(); }
|
||||
constexpr InstanceCounter &operator=(const InstanceCounter &) noexcept
|
||||
{ return *this; }
|
||||
|
||||
void updatePeak()
|
||||
{
|
||||
|
@ -106,6 +106,8 @@ struct Complex
|
||||
{
|
||||
--instanceCount;
|
||||
}
|
||||
constexpr Complex &operator=(const Complex &o) noexcept
|
||||
{ i = o.i; return *this; }
|
||||
|
||||
int i;
|
||||
static int instanceCount;
|
||||
|
@ -359,6 +359,7 @@ struct KeyType
|
||||
int foo;
|
||||
|
||||
KeyType(int x) : foo(x) {}
|
||||
constexpr KeyType(const KeyType &o) noexcept : foo(o.foo) {}
|
||||
|
||||
private:
|
||||
KeyType &operator=(const KeyType &);
|
||||
|
@ -97,6 +97,8 @@ struct Foo {
|
||||
Foo():c(count) { ++count; }
|
||||
Foo(const Foo& o):c(o.c) { ++count; }
|
||||
~Foo() { --count; }
|
||||
constexpr Foo &operator=(const Foo &o) noexcept { c = o.c; return *this; }
|
||||
|
||||
int c;
|
||||
int data[8];
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user