Skip to content
Snippets Groups Projects
Commit 3f2007a5 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

simplification of std container wrappers

parent e7dd908b
No related branches found
No related tags found
No related merge requests found
...@@ -27,23 +27,15 @@ public: ...@@ -27,23 +27,15 @@ public:
bitset ( ) noexcept : std::bitset < N > ( ) { bitset ( ) noexcept : std::bitset < N > ( ) {
} }
   
bitset ( const bitset & other ) noexcept : std::bitset < N > ( other ) { bitset ( const bitset & other ) = default;
}
   
bitset ( bitset && other ) noexcept : std::bitset < N > ( std::move ( other ) ) { bitset ( bitset && other ) = default;
}
   
using std::bitset < N >::bitset; using std::bitset < N >::bitset;
   
bitset & operator = ( bitset && other ) noexcept { bitset & operator = ( bitset && other ) = default;
static_cast < std::bitset < N > & > ( * this ) = std::move ( other );
return * this;
}
   
bitset & operator = ( const bitset & other ) noexcept { bitset & operator = ( const bitset & other ) = default;
static_cast < std::bitset < N > & > ( * this ) = other;
return * this;
}
   
using std::bitset < N >::operator =; using std::bitset < N >::operator =;
#endif #endif
......
...@@ -27,23 +27,15 @@ public: ...@@ -27,23 +27,15 @@ public:
deque ( ) noexcept : std::deque < T, Alloc > ( ) { deque ( ) noexcept : std::deque < T, Alloc > ( ) {
} }
   
deque ( const deque & other ) noexcept : std::deque < T, Alloc > ( other ) { deque ( const deque & other ) = default;
}
   
deque ( deque && other ) noexcept : std::deque < T, Alloc > ( std::move ( other ) ) { deque ( deque && other ) = default;
}
   
using std::deque < T, Alloc >::deque; using std::deque < T, Alloc >::deque;
   
deque & operator = ( deque && other ) noexcept { deque & operator = ( deque && other ) = default;
static_cast < std::deque < T, Alloc > & > ( * this ) = std::move ( other );
return * this;
}
   
deque & operator = ( const deque & other ) noexcept { deque & operator = ( const deque & other ) = default;
static_cast < std::deque < T, Alloc > & > ( * this ) = other;
return * this;
}
   
using std::deque < T, Alloc >::operator =; using std::deque < T, Alloc >::operator =;
#endif #endif
......
...@@ -27,23 +27,15 @@ public: ...@@ -27,23 +27,15 @@ public:
list ( ) noexcept : std::list < T, Alloc > ( ) { list ( ) noexcept : std::list < T, Alloc > ( ) {
} }
   
list ( const list & other ) noexcept : std::list < T, Alloc > ( other ) { list ( const list & other ) = default;
}
   
list ( list && other ) noexcept : std::list < T, Alloc > ( std::move ( other ) ) { list ( list && other ) = default;
}
   
using std::list < T, Alloc >::list; using std::list < T, Alloc >::list;
   
list & operator = ( list && other ) noexcept { list & operator = ( list && other ) = default;
static_cast < std::list < T, Alloc > & > ( * this ) = std::move ( other );
return * this;
}
   
list & operator = ( const list & other ) noexcept { list & operator = ( const list & other ) = default;
static_cast < std::list < T, Alloc > & > ( * this ) = other;
return * this;
}
   
using std::list < T, Alloc >::operator =; using std::list < T, Alloc >::operator =;
#endif #endif
......
...@@ -29,23 +29,15 @@ public: ...@@ -29,23 +29,15 @@ public:
map ( ) noexcept : std::map < T, R, Cmp, Alloc > ( ) { map ( ) noexcept : std::map < T, R, Cmp, Alloc > ( ) {
} }
   
map ( const map & other ) noexcept : std::map < T, R, Cmp, Alloc > ( other ) { map ( const map & other ) = default;
}
   
map ( map && other ) noexcept : std::map < T, R, Cmp, Alloc > ( std::move ( other ) ) { map ( map && other ) = default;
}
   
using std::map < T, R, Cmp, Alloc >::map; using std::map < T, R, Cmp, Alloc >::map;
   
map & operator = ( map && other ) noexcept { map & operator = ( map && other ) = default;
static_cast < std::map < T, R, Cmp, Alloc > & > ( * this ) = std::move ( other );
return * this;
}
   
map & operator = ( const map & other ) noexcept { map & operator = ( const map & other ) = default;
static_cast < std::map < T, R, Cmp, Alloc > & > ( * this ) = other;
return * this;
}
   
using std::map < T, R, Cmp, Alloc >::operator =; using std::map < T, R, Cmp, Alloc >::operator =;
#endif #endif
......
...@@ -24,23 +24,15 @@ public: ...@@ -24,23 +24,15 @@ public:
using std::pair < T, R >::pair; using std::pair < T, R >::pair;
using std::pair < T, R >::operator =; using std::pair < T, R >::operator =;
#else #else
pair ( const pair & other ) noexcept : std::pair < T, R > ( other ) { pair ( const pair & other ) = default;
}
   
pair ( pair && other ) noexcept : std::pair < T, R > ( std::move ( other ) ) { pair ( pair && other ) = default;
}
   
using std::pair < T, R >::pair; using std::pair < T, R >::pair;
   
pair & operator = ( pair && other ) noexcept { pair & operator = ( pair && other ) = default;
static_cast < std::pair < T, R > & > ( * this ) = std::move ( other );
return * this;
}
   
pair & operator = ( const pair & other ) noexcept { pair & operator = ( const pair & other ) = default;
static_cast < std::pair < T, R > & > ( * this ) = other;
return * this;
}
   
using std::pair < T, R >::operator =; using std::pair < T, R >::operator =;
#endif #endif
......
...@@ -27,23 +27,15 @@ public: ...@@ -27,23 +27,15 @@ public:
set ( ) noexcept : std::set < T, Cmp, Alloc > ( ) { set ( ) noexcept : std::set < T, Cmp, Alloc > ( ) {
} }
   
set ( const set & other ) noexcept : std::set < T, Cmp, Alloc > ( other ) { set ( const set & other ) = default;
}
   
set ( set && other ) noexcept : std::set < T, Cmp, Alloc > ( std::move ( other ) ) { set ( set && other ) = default;
}
   
using std::set < T, Cmp, Alloc >::set; using std::set < T, Cmp, Alloc >::set;
   
set & operator = ( set && other ) noexcept { set & operator = ( set && other ) = default;
static_cast < std::set < T, Cmp, Alloc > & > ( * this ) = std::move ( other );
return * this;
}
   
set & operator = ( const set & other ) noexcept { set & operator = ( const set & other ) = default;
static_cast < std::set < T, Cmp, Alloc > & > ( * this ) = other;
return * this;
}
   
using std::set < T, Cmp, Alloc >::operator =; using std::set < T, Cmp, Alloc >::operator =;
#endif #endif
......
...@@ -24,23 +24,15 @@ public: ...@@ -24,23 +24,15 @@ public:
string ( ) noexcept : std::string ( ) { string ( ) noexcept : std::string ( ) {
} }
   
string ( const string & other ) noexcept : std::string ( other ) { string ( const string & other ) = default;
}
   
string ( string && other ) noexcept : std::string ( std::move ( other ) ) { string ( string && other ) = default;
}
   
using std::string::string; using std::string::string;
   
string & operator = ( string && other ) noexcept { string & operator = ( string && other ) = default;
static_cast < std::string & > ( * this ) = std::move ( other );
return * this;
}
   
string & operator = ( const string & other ) noexcept { string & operator = ( const string & other ) = default;
static_cast < std::string & > ( * this ) = other;
return * this;
}
   
using std::string::operator =; using std::string::operator =;
#endif #endif
......
...@@ -27,23 +27,15 @@ public: ...@@ -27,23 +27,15 @@ public:
tuple ( ) noexcept : std::tuple < Ts ... > ( ) { tuple ( ) noexcept : std::tuple < Ts ... > ( ) {
} }
   
tuple ( const tuple & other ) noexcept : std::tuple < Ts ... > ( other ) { tuple ( const tuple & other ) = default;
}
   
tuple ( tuple && other ) noexcept : std::tuple < Ts ... > ( std::move ( other ) ) { tuple ( tuple && other ) = default;
}
   
using std::tuple < Ts ... >::tuple; using std::tuple < Ts ... >::tuple;
   
tuple & operator = ( tuple && other ) noexcept { tuple & operator = ( tuple && other ) = default;
static_cast < std::tuple < Ts ... > & > ( * this ) = std::move ( other );
return * this;
}
   
tuple & operator = ( const tuple & other ) noexcept { tuple & operator = ( const tuple & other ) = default;
static_cast < std::tuple < Ts ... > & > ( * this ) = other;
return * this;
}
   
using std::tuple < Ts ... >::operator =; using std::tuple < Ts ... >::operator =;
#endif #endif
......
...@@ -27,23 +27,15 @@ public: ...@@ -27,23 +27,15 @@ public:
unordered_map ( ) noexcept : std::unordered_map < T, R, Hash, KeyEqual, Alloc > ( ) { unordered_map ( ) noexcept : std::unordered_map < T, R, Hash, KeyEqual, Alloc > ( ) {
} }
   
unordered_map ( const unordered_map & other ) noexcept : std::unordered_map < T, R, Hash, KeyEqual, Alloc > ( other ) { unordered_map ( const unordered_map & other ) = default;
}
   
unordered_map ( unordered_map && other ) noexcept : std::unordered_map < T, R, Hash, KeyEqual, Alloc > ( std::move ( other ) ) { unordered_map ( unordered_map && other ) = default;
}
   
using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::unordered_map; using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::unordered_map;
   
unordered_map & operator = ( unordered_map && other ) noexcept { unordered_map & operator = ( unordered_map && other ) = default;
static_cast < std::unordered_map < T, R, Hash, KeyEqual, Alloc > & > ( * this ) = std::move ( other );
return * this;
}
   
unordered_map & operator = ( const unordered_map & other ) noexcept { unordered_map & operator = ( const unordered_map & other ) = default;
static_cast < std::unordered_map < T, R, Hash, KeyEqual, Alloc > & > ( * this ) = other;
return * this;
}
   
using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::operator =; using std::unordered_map < T, R, Hash, KeyEqual, Alloc >::operator =;
#endif #endif
......
...@@ -27,23 +27,15 @@ public: ...@@ -27,23 +27,15 @@ public:
vector ( ) noexcept : std::vector < T, Alloc > ( ) { vector ( ) noexcept : std::vector < T, Alloc > ( ) {
} }
   
vector ( const vector & other ) noexcept : std::vector < T, Alloc > ( other ) { vector ( const vector & other ) = default;
}
   
vector ( vector && other ) noexcept : std::vector < T, Alloc > ( std::move ( other ) ) { vector ( vector && other ) = default;
}
   
using std::vector < T, Alloc >::vector; using std::vector < T, Alloc >::vector;
   
vector & operator = ( vector && other ) noexcept { vector & operator = ( vector && other ) = default;
static_cast < std::vector < T, Alloc > & > ( * this ) = std::move ( other );
return * this;
}
   
vector & operator = ( const vector & other ) noexcept { vector & operator = ( const vector & other ) = default;
static_cast < std::vector < T, Alloc > & > ( * this ) = other;
return * this;
}
   
using std::vector < T, Alloc >::operator =; using std::vector < T, Alloc >::operator =;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment