Remove unnecessary copy ctors/copy assignment operators

C++11 deprecates having one without the other.
Eliminates many, many GCC -Wdeprecated-copy warnings.
This commit is contained in:
Paul Cornett
2019-10-14 09:07:21 -07:00
parent 764c01832d
commit a3598ba33f
15 changed files with 0 additions and 106 deletions

View File

@@ -450,11 +450,6 @@ CLASSEXP CLASSNAME \
public: \
CLASSNAME() { } \
const_key_reference operator()( const_pair_reference pair ) const { return pair.first; }\
\
/* the dummy assignment operator is needed to suppress compiler */ \
/* warnings from hash table class' operator=(): gcc complains about */ \
/* "statement with no effect" without it */ \
CLASSNAME& operator=(const CLASSNAME&) { return *this; } \
};
// grow/shrink predicates
@@ -471,10 +466,6 @@ inline bool grow_lf70( size_t buckets, size_t items )
// hashing and comparison functors
// ----------------------------------------------------------------------------
// NB: implementation detail: all of these classes must have dummy assignment
// operators to suppress warnings about "statement with no effect" from gcc
// in the hash table class assignment operator (where they're assigned)
#ifndef wxNEEDS_WX_HASH_MAP
// integer types
@@ -536,8 +527,6 @@ struct WXDLLIMPEXP_BASE wxIntegerHash
wxULongLong_t operator()( wxLongLong_t x ) const { return static_cast<wxULongLong_t>(x); }
wxULongLong_t operator()( wxULongLong_t x ) const { return x; }
#endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
wxIntegerHash& operator=(const wxIntegerHash&) { return *this; }
};
#endif // !wxNEEDS_WX_HASH_MAP/wxNEEDS_WX_HASH_MAP
@@ -555,8 +544,6 @@ struct WXDLLIMPEXP_BASE wxIntegerEqual
bool operator()( wxLongLong_t a, wxLongLong_t b ) const { return a == b; }
bool operator()( wxULongLong_t a, wxULongLong_t b ) const { return a == b; }
#endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
wxIntegerEqual& operator=(const wxIntegerEqual&) { return *this; }
};
// pointers
@@ -569,16 +556,12 @@ struct WXDLLIMPEXP_BASE wxPointerHash
#else
size_t operator()( const void* k ) const { return (size_t)k; }
#endif
wxPointerHash& operator=(const wxPointerHash&) { return *this; }
};
struct WXDLLIMPEXP_BASE wxPointerEqual
{
wxPointerEqual() { }
bool operator()( const void* a, const void* b ) const { return a == b; }
wxPointerEqual& operator=(const wxPointerEqual&) { return *this; }
};
// wxString, char*, wchar_t*
@@ -603,8 +586,6 @@ struct WXDLLIMPEXP_BASE wxStringHash
static unsigned long stringHash( const wchar_t* );
static unsigned long stringHash( const char* );
wxStringHash& operator=(const wxStringHash&) { return *this; }
};
struct WXDLLIMPEXP_BASE wxStringEqual
@@ -618,8 +599,6 @@ struct WXDLLIMPEXP_BASE wxStringEqual
bool operator()( const char* a, const char* b ) const
{ return strcmp( a, b ) == 0; }
#endif // wxUSE_UNICODE
wxStringEqual& operator=(const wxStringEqual&) { return *this; }
};
#ifdef wxNEEDS_WX_HASH_MAP