Define explicit copy ctor for classes with assignment operator
This avoids clang -Wdeprecated-copy enabled by -Wextra when building the test.
This commit is contained in:
parent
0f73473ae6
commit
9952af8e93
1 changed files with 4 additions and 0 deletions
|
|
@ -497,6 +497,8 @@ struct MyStruct
|
||||||
class MyHash
|
class MyHash
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
MyHash() = default;
|
||||||
|
MyHash(const MyHash&) = default;
|
||||||
unsigned long operator()(const MyStruct& s) const
|
unsigned long operator()(const MyStruct& s) const
|
||||||
{ return m_dummy(s.ptr); }
|
{ return m_dummy(s.ptr); }
|
||||||
MyHash& operator=(const MyHash&) { return *this; }
|
MyHash& operator=(const MyHash&) { return *this; }
|
||||||
|
|
@ -507,6 +509,8 @@ private:
|
||||||
class MyEqual
|
class MyEqual
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
MyEqual() = default;
|
||||||
|
MyEqual(const MyEqual&) = default;
|
||||||
bool operator()(const MyStruct& s1, const MyStruct& s2) const
|
bool operator()(const MyStruct& s1, const MyStruct& s2) const
|
||||||
{ return s1.ptr == s2.ptr; }
|
{ return s1.ptr == s2.ptr; }
|
||||||
MyEqual& operator=(const MyEqual&) { return *this; }
|
MyEqual& operator=(const MyEqual&) { return *this; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue