@@ -101,11 +101,7 @@ class StringBase : public StringCore<StorageType>
101101 // default destructor, move and copy
102102 ~StringBase () = default ;
103103 StringBase (const this_type&) = default ;
104- #ifdef SPSL_HAS_DEFAULT_MOVE
105- StringBase (this_type&&) = default;
106- #else
107- StringBase (this_type&& rhs) { this ->swap (rhs); }
108- #endif
104+ StringBase (this_type&& rhs) noexcept : StringBase() { this ->swap (rhs); }
109105
110106 // / construct from another storage instance
111107 explicit StringBase (const storage_type& storage) : base_type(storage) {}
@@ -138,15 +134,11 @@ class StringBase : public StringCore<StorageType>
138134
139135 // default copy & move
140136 this_type& operator =(const this_type&) = default ;
141- #ifdef SPSL_HAS_DEFAULT_MOVE
142- this_type& operator =(this_type&&) = default ;
143- #else
144- this_type& operator =(this_type&& rhs)
137+ this_type& operator =(this_type&& rhs) noexcept
145138 {
146139 this ->swap (rhs);
147140 return *this ;
148141 }
149- #endif
150142
151143 // / allow assignment from another string-like container (may even be a vector...)
152144 template <typename StringClass, typename std::enable_if<is_compatible_string<
@@ -295,8 +287,8 @@ class StringBase : public StringCore<StorageType>
295287 template <class InputIt , typename = checkInputIter<InputIt>>
296288 this_type& replace (const_iterator first, const_iterator last, InputIt first2, InputIt last2)
297289 {
298- size_type pos = static_cast <size_type>(first - data ());
299- size_type count = static_cast <size_type>(last - first);
290+ auto pos = static_cast <size_type>(first - data ());
291+ auto count = static_cast <size_type>(last - first);
300292 if (pos > size ())
301293 throw std::out_of_range (" replace: pos > size()" );
302294 if (pos + count > size ())
@@ -556,17 +548,9 @@ struct hash<spsl::StringBase<StorageType>>
556548
557549 hash () = default ;
558550 hash (const hash&) = default ;
559- #ifdef SPSL_HAS_DEFAULT_MOVE
560- hash (hash&&) = default;
561- #else
562- hash (hash&&) {}
563- #endif
551+ hash (hash&&) noexcept {}
564552 hash& operator =(const hash&) = default ;
565- #ifdef SPSL_HAS_DEFAULT_MOVE
566- hash& operator =(hash&&) = default ;
567- #else
568- hash& operator =(hash&&) { return *this ; }
569- #endif
553+ hash& operator =(hash&&) noexcept { return *this ; }
570554 ~hash () = default ;
571555
572556 size_t operator ()(const argument_type& s) const
0 commit comments