External, Non-PPA KXStudio Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

990 lines
35KB

  1. diff --git a/source/modules/water/buffers/AudioSampleBuffer.h b/source/modules/water/buffers/AudioSampleBuffer.h
  2. index 1716c5efd..8ae1e6388 100644
  3. --- a/source/modules/water/buffers/AudioSampleBuffer.h
  4. +++ b/source/modules/water/buffers/AudioSampleBuffer.h
  5. @@ -205,39 +205,6 @@ public:
  6. */
  7. ~AudioSampleBuffer() noexcept {}
  8. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  9. - /** Move constructor */
  10. - AudioSampleBuffer (AudioSampleBuffer&& other) noexcept
  11. - : numChannels (other.numChannels),
  12. - size (other.size),
  13. - allocatedBytes (other.allocatedBytes),
  14. - channels (other.channels),
  15. - allocatedData (static_cast<HeapBlock<char>&&> (other.allocatedData)),
  16. - isClear (other.isClear)
  17. - {
  18. - std::memcpy (preallocatedChannelSpace, other.preallocatedChannelSpace, sizeof (preallocatedChannelSpace));
  19. - other.numChannels = 0;
  20. - other.size = 0;
  21. - other.allocatedBytes = 0;
  22. - }
  23. -
  24. - /** Move assignment */
  25. - AudioSampleBuffer& operator= (AudioSampleBuffer&& other) noexcept
  26. - {
  27. - numChannels = other.numChannels;
  28. - size = other.size;
  29. - allocatedBytes = other.allocatedBytes;
  30. - channels = other.channels;
  31. - allocatedData = static_cast<HeapBlock<char>&&> (other.allocatedData);
  32. - isClear = other.isClear;
  33. - memcpy (preallocatedChannelSpace, other.preallocatedChannelSpace, sizeof (preallocatedChannelSpace));
  34. - other.numChannels = 0;
  35. - other.size = 0;
  36. - other.allocatedBytes = 0;
  37. - return *this;
  38. - }
  39. - #endif
  40. -
  41. //==============================================================================
  42. /** Returns the number of channels of audio data that this buffer contains.
  43. @see getSampleData
  44. diff --git a/source/modules/water/containers/Array.h b/source/modules/water/containers/Array.h
  45. index a03857e55..e4367c9f2 100644
  46. --- a/source/modules/water/containers/Array.h
  47. +++ b/source/modules/water/containers/Array.h
  48. @@ -81,15 +81,6 @@ public:
  49. new (data.elements + i) ElementType (other.data.elements[i]);
  50. }
  51. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  52. - Array (Array<ElementType>&& other) noexcept
  53. - : data (static_cast<ArrayAllocationBase<ElementType>&&> (other.data)),
  54. - numUsed (other.numUsed)
  55. - {
  56. - other.numUsed = 0;
  57. - }
  58. - #endif
  59. -
  60. /** Initalises from a null-terminated C array of values.
  61. @param values the array to copy from
  62. @@ -137,17 +128,6 @@ public:
  63. return *this;
  64. }
  65. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  66. - Array& operator= (Array&& other) noexcept
  67. - {
  68. - deleteAllElements();
  69. - data = static_cast<ArrayAllocationBase<ElementType>&&> (other.data);
  70. - numUsed = other.numUsed;
  71. - other.numUsed = 0;
  72. - return *this;
  73. - }
  74. - #endif
  75. -
  76. //==============================================================================
  77. /** Compares this array to another one.
  78. Two arrays are considered equal if they both contain the same set of
  79. @@ -380,22 +360,6 @@ public:
  80. return true;
  81. }
  82. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  83. - /** Appends a new element at the end of the array.
  84. -
  85. - @param newElement the new object to add to the array
  86. - @see set, insert, addIfNotAlreadyThere, addSorted, addUsingDefaultSort, addArray
  87. - */
  88. - bool add (ElementType&& newElement) noexcept
  89. - {
  90. - if (! data.ensureAllocatedSize (static_cast<size_t>(numUsed + 1)))
  91. - return false;
  92. -
  93. - new (data.elements + numUsed++) ElementType (static_cast<ElementType&&> (newElement));
  94. - return true;
  95. - }
  96. - #endif
  97. -
  98. /** Inserts a new element into the array at a given position.
  99. If the index is less than 0 or greater than the size of the array, the
  100. diff --git a/source/modules/water/containers/ArrayAllocationBase.h b/source/modules/water/containers/ArrayAllocationBase.h
  101. index f3049d8e5..878ad81fc 100644
  102. --- a/source/modules/water/containers/ArrayAllocationBase.h
  103. +++ b/source/modules/water/containers/ArrayAllocationBase.h
  104. @@ -44,29 +44,6 @@ namespace water {
  105. template <class ElementType>
  106. class ArrayAllocationBase
  107. {
  108. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  109. -private:
  110. - #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
  111. - template <typename T>
  112. - struct IsTriviallyCopyable : std::integral_constant<bool, false> {};
  113. - #else
  114. - template <typename T>
  115. - using IsTriviallyCopyable = std::is_trivially_copyable<T>;
  116. - #endif
  117. -
  118. - template <typename T>
  119. - using TriviallyCopyableVoid = typename std::enable_if<IsTriviallyCopyable<T>::value, void>::type;
  120. -
  121. - template <typename T>
  122. - using TriviallyCopyableBool = typename std::enable_if<IsTriviallyCopyable<T>::value, bool>::type;
  123. -
  124. - template <typename T>
  125. - using NonTriviallyCopyableVoid = typename std::enable_if<! IsTriviallyCopyable<T>::value, void>::type;
  126. -
  127. - template <typename T>
  128. - using NonTriviallyCopyableBool = typename std::enable_if<! IsTriviallyCopyable<T>::value, bool>::type;
  129. -#endif // WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  130. -
  131. public:
  132. //==============================================================================
  133. /** Creates an empty array. */
  134. @@ -81,19 +58,6 @@ public:
  135. {
  136. }
  137. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  138. - ArrayAllocationBase (ArrayAllocationBase<ElementType>&& other) noexcept
  139. - : elements (static_cast<HeapBlock<ElementType>&&> (other.elements)),
  140. - numAllocated (other.numAllocated) {}
  141. -
  142. - ArrayAllocationBase& operator= (ArrayAllocationBase<ElementType>&& other) noexcept
  143. - {
  144. - elements = static_cast<HeapBlock<ElementType>&&> (other.elements);
  145. - numAllocated = other.numAllocated;
  146. - return *this;
  147. - }
  148. - #endif
  149. -
  150. //==============================================================================
  151. /** Changes the amount of storage allocated.
  152. @@ -102,12 +66,7 @@ public:
  153. @param numNewElements the number of elements that are needed
  154. */
  155. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  156. - template <typename T = ElementType> TriviallyCopyableBool<T>
  157. - #else
  158. - bool
  159. - #endif
  160. - setAllocatedSize (const size_t numNewElements) noexcept
  161. + bool setAllocatedSize (const size_t numNewElements) noexcept
  162. {
  163. if (numAllocated != numNewElements)
  164. {
  165. @@ -127,43 +86,6 @@ public:
  166. return true;
  167. }
  168. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  169. - template <typename T = ElementType>
  170. - NonTriviallyCopyableBool<T> setAllocatedSize (const size_t numNewElements) noexcept
  171. - {
  172. - if (numAllocated == numNewElements)
  173. - return true;
  174. -
  175. - if (numNewElements > 0)
  176. - {
  177. - HeapBlock<ElementType> newElements;
  178. -
  179. - if (! newElements.malloc (numNewElements))
  180. - return false;
  181. -
  182. - size_t i = 0;
  183. -
  184. - for (; i < numAllocated && i < numNewElements; ++i)
  185. - {
  186. - new (newElements + i) ElementType (std::move (elements[i]));
  187. - elements[i].~ElementType();
  188. - }
  189. -
  190. - for (; i < numNewElements; ++i)
  191. - new (newElements + i) ElementType ();
  192. -
  193. - elements = std::move (newElements);
  194. - }
  195. - else
  196. - {
  197. - elements.free();
  198. - }
  199. -
  200. - numAllocated = numNewElements;
  201. - return true;
  202. - }
  203. - #endif
  204. -
  205. /** Increases the amount of storage allocated if it is less than a given amount.
  206. This will retain any data currently held in the array, but will add
  207. @@ -198,12 +120,7 @@ public:
  208. std::swap (numAllocated, other.numAllocated);
  209. }
  210. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  211. - template <typename T = ElementType> TriviallyCopyableVoid<T>
  212. - #else
  213. - void
  214. - #endif
  215. - moveMemory (ElementType* target, const ElementType* source, const size_t numElements) noexcept
  216. + void moveMemory (ElementType* target, const ElementType* source, const size_t numElements) noexcept
  217. {
  218. CARLA_SAFE_ASSERT_RETURN(target != nullptr,);
  219. CARLA_SAFE_ASSERT_RETURN(source != nullptr,);
  220. @@ -213,42 +130,6 @@ public:
  221. std::memmove (target, source, ((size_t) numElements) * sizeof (ElementType));
  222. }
  223. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  224. - template <typename T = ElementType>
  225. - NonTriviallyCopyableVoid<T> moveMemory (ElementType* target, const ElementType* source, const size_t numElements) noexcept
  226. - {
  227. - CARLA_SAFE_ASSERT_RETURN(target != nullptr,);
  228. - CARLA_SAFE_ASSERT_RETURN(source != nullptr,);
  229. - CARLA_SAFE_ASSERT_RETURN(target != source,);
  230. - CARLA_SAFE_ASSERT_RETURN(numElements != 0,);
  231. -
  232. - if (target > source)
  233. - {
  234. - for (size_t i = 0; i < numElements; ++i)
  235. - {
  236. - moveElement (target, std::move (*source));
  237. - ++target;
  238. - ++source;
  239. - }
  240. - }
  241. - else
  242. - {
  243. - for (size_t i = 0; i < numElements; ++i)
  244. - {
  245. - moveElement (target, std::move (*source));
  246. - --target;
  247. - --source;
  248. - }
  249. - }
  250. - }
  251. -
  252. - void moveElement (ElementType* destination, const ElementType&& source)
  253. - {
  254. - destination->~ElementType();
  255. - new (destination) ElementType (std::move (source));
  256. - }
  257. - #endif
  258. -
  259. //==============================================================================
  260. HeapBlock<ElementType> elements;
  261. size_t numAllocated;
  262. diff --git a/source/modules/water/containers/LinkedListPointer.h b/source/modules/water/containers/LinkedListPointer.h
  263. index c71d52d23..ed75fc268 100644
  264. --- a/source/modules/water/containers/LinkedListPointer.h
  265. +++ b/source/modules/water/containers/LinkedListPointer.h
  266. @@ -81,23 +81,6 @@ public:
  267. return *this;
  268. }
  269. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  270. - LinkedListPointer (LinkedListPointer&& other) noexcept
  271. - : item (other.item)
  272. - {
  273. - other.item = nullptr;
  274. - }
  275. -
  276. - LinkedListPointer& operator= (LinkedListPointer&& other) noexcept
  277. - {
  278. - wassert (this != &other); // hopefully the compiler should make this situation impossible!
  279. -
  280. - item = other.item;
  281. - other.item = nullptr;
  282. - return *this;
  283. - }
  284. - #endif
  285. -
  286. //==============================================================================
  287. /** Returns the item which this pointer points to. */
  288. inline operator ObjectType*() const noexcept
  289. diff --git a/source/modules/water/containers/NamedValueSet.cpp b/source/modules/water/containers/NamedValueSet.cpp
  290. index 9302e1691..7543af158 100644
  291. --- a/source/modules/water/containers/NamedValueSet.cpp
  292. +++ b/source/modules/water/containers/NamedValueSet.cpp
  293. @@ -44,19 +44,6 @@ NamedValueSet& NamedValueSet::operator= (const NamedValueSet& other)
  294. return *this;
  295. }
  296. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  297. -NamedValueSet::NamedValueSet (NamedValueSet&& other) noexcept
  298. - : values (static_cast<Array<NamedValue>&&> (other.values))
  299. -{
  300. -}
  301. -
  302. -NamedValueSet& NamedValueSet::operator= (NamedValueSet&& other) noexcept
  303. -{
  304. - other.values.swapWith (values);
  305. - return *this;
  306. -}
  307. -#endif
  308. -
  309. NamedValueSet::~NamedValueSet() noexcept
  310. {
  311. }
  312. @@ -117,23 +104,6 @@ var* NamedValueSet::getVarPointer (const Identifier& name) const noexcept
  313. return nullptr;
  314. }
  315. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  316. -bool NamedValueSet::set (const Identifier& name, var&& newValue)
  317. -{
  318. - if (var* const v = getVarPointer (name))
  319. - {
  320. - if (v->equalsWithSameType (newValue))
  321. - return false;
  322. -
  323. - *v = static_cast<var&&> (newValue);
  324. - return true;
  325. - }
  326. -
  327. - values.add (NamedValue (name, static_cast<var&&> (newValue)));
  328. - return true;
  329. -}
  330. -#endif
  331. -
  332. bool NamedValueSet::set (const Identifier& name, const var& newValue)
  333. {
  334. if (var* const v = getVarPointer (name))
  335. diff --git a/source/modules/water/containers/NamedValueSet.h b/source/modules/water/containers/NamedValueSet.h
  336. index 7d0caa02e..ea4ef421d 100644
  337. --- a/source/modules/water/containers/NamedValueSet.h
  338. +++ b/source/modules/water/containers/NamedValueSet.h
  339. @@ -50,11 +50,6 @@ public:
  340. /** Replaces this set with a copy of another set. */
  341. NamedValueSet& operator= (const NamedValueSet&);
  342. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  343. - NamedValueSet (NamedValueSet&&) noexcept;
  344. - NamedValueSet& operator= (NamedValueSet&&) noexcept;
  345. - #endif
  346. -
  347. /** Destructor. */
  348. ~NamedValueSet() noexcept;
  349. @@ -68,27 +63,6 @@ public:
  350. NamedValue (const Identifier& n, const var& v) : name (n), value (v) {}
  351. NamedValue (const NamedValue& other) : name (other.name), value (other.value) {}
  352. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  353. - NamedValue (NamedValue&& other) noexcept
  354. - : name (static_cast<Identifier&&> (other.name)),
  355. - value (static_cast<var&&> (other.value))
  356. - {
  357. - }
  358. -
  359. - NamedValue (Identifier&& n, var&& v) noexcept
  360. - : name (static_cast<Identifier&&> (n)),
  361. - value (static_cast<var&&> (v))
  362. - {
  363. - }
  364. -
  365. - NamedValue& operator= (NamedValue&& other) noexcept
  366. - {
  367. - name = static_cast<Identifier&&> (other.name);
  368. - value = static_cast<var&&> (other.value);
  369. - return *this;
  370. - }
  371. - #endif
  372. -
  373. bool operator== (const NamedValue& other) const noexcept { return name == other.name && value == other.value; }
  374. bool operator!= (const NamedValue& other) const noexcept { return ! operator== (other); }
  375. @@ -124,14 +98,6 @@ public:
  376. */
  377. bool set (const Identifier& name, const var& newValue);
  378. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  379. - /** Changes or adds a named value.
  380. - @returns true if a value was changed or added; false if the
  381. - value was already set the value passed-in.
  382. - */
  383. - bool set (const Identifier& name, var&& newValue);
  384. - #endif
  385. -
  386. /** Returns true if the set contains an item with the specified name. */
  387. bool contains (const Identifier& name) const noexcept;
  388. diff --git a/source/modules/water/containers/OwnedArray.h b/source/modules/water/containers/OwnedArray.h
  389. index 1a90100cd..ffa89203f 100644
  390. --- a/source/modules/water/containers/OwnedArray.h
  391. +++ b/source/modules/water/containers/OwnedArray.h
  392. @@ -73,25 +73,6 @@ public:
  393. deleteAllObjects();
  394. }
  395. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  396. - OwnedArray (OwnedArray&& other) noexcept
  397. - : data (static_cast<ArrayAllocationBase <ObjectClass*>&&> (other.data)),
  398. - numUsed (other.numUsed)
  399. - {
  400. - other.numUsed = 0;
  401. - }
  402. -
  403. - OwnedArray& operator= (OwnedArray&& other) noexcept
  404. - {
  405. - deleteAllObjects();
  406. -
  407. - data = static_cast<ArrayAllocationBase <ObjectClass*>&&> (other.data);
  408. - numUsed = other.numUsed;
  409. - other.numUsed = 0;
  410. - return *this;
  411. - }
  412. - #endif
  413. -
  414. //==============================================================================
  415. /** Clears the array, optionally deleting the objects inside it first. */
  416. void clear (bool deleteObjects = true)
  417. diff --git a/source/modules/water/containers/Variant.cpp b/source/modules/water/containers/Variant.cpp
  418. index a93dba9fb..0472b10e3 100644
  419. --- a/source/modules/water/containers/Variant.cpp
  420. +++ b/source/modules/water/containers/Variant.cpp
  421. @@ -265,34 +265,6 @@ var& var::operator= (const double v) { type->cleanUp (value); type =
  422. var& var::operator= (const char* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
  423. var& var::operator= (const String& v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; }
  424. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  425. -var::var (var&& other) noexcept
  426. - : type (other.type),
  427. - value (other.value)
  428. -{
  429. - other.type = &VariantType_Void::instance;
  430. -}
  431. -
  432. -var& var::operator= (var&& other) noexcept
  433. -{
  434. - swapWith (other);
  435. - return *this;
  436. -}
  437. -
  438. -var::var (String&& v) : type (&VariantType_String::instance)
  439. -{
  440. - new (value.stringValue) String (static_cast<String&&> (v));
  441. -}
  442. -
  443. -var& var::operator= (String&& v)
  444. -{
  445. - type->cleanUp (value);
  446. - type = &VariantType_String::instance;
  447. - new (value.stringValue) String (static_cast<String&&> (v));
  448. - return *this;
  449. -}
  450. -#endif
  451. -
  452. //==============================================================================
  453. bool var::equals (const var& other) const noexcept
  454. {
  455. diff --git a/source/modules/water/containers/Variant.h b/source/modules/water/containers/Variant.h
  456. index 0e181712a..c1472a733 100644
  457. --- a/source/modules/water/containers/Variant.h
  458. +++ b/source/modules/water/containers/Variant.h
  459. @@ -69,13 +69,6 @@ public:
  460. var& operator= (const char* value);
  461. var& operator= (const String& value);
  462. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  463. - var (var&&) noexcept;
  464. - var (String&&);
  465. - var& operator= (var&&) noexcept;
  466. - var& operator= (String&&);
  467. - #endif
  468. -
  469. void swapWith (var& other) noexcept;
  470. /** Returns a var object that can be used where you need the javascript "undefined" value. */
  471. diff --git a/source/modules/water/files/File.cpp b/source/modules/water/files/File.cpp
  472. index 2ce0f6f8e..8c74854f0 100644
  473. --- a/source/modules/water/files/File.cpp
  474. +++ b/source/modules/water/files/File.cpp
  475. @@ -86,19 +86,6 @@ File& File::operator= (const File& other)
  476. return *this;
  477. }
  478. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  479. -File::File (File&& other) noexcept
  480. - : fullPath (static_cast<String&&> (other.fullPath))
  481. -{
  482. -}
  483. -
  484. -File& File::operator= (File&& other) noexcept
  485. -{
  486. - fullPath = static_cast<String&&> (other.fullPath);
  487. - return *this;
  488. -}
  489. -#endif
  490. -
  491. bool File::isNull() const
  492. {
  493. return fullPath.isEmpty();
  494. diff --git a/source/modules/water/files/File.h b/source/modules/water/files/File.h
  495. index 1fa1a7c3e..2c8077963 100644
  496. --- a/source/modules/water/files/File.h
  497. +++ b/source/modules/water/files/File.h
  498. @@ -89,11 +89,6 @@ public:
  499. /** Copies from another file object. */
  500. File& operator= (const File& otherFile);
  501. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  502. - File (File&&) noexcept;
  503. - File& operator= (File&&) noexcept;
  504. - #endif
  505. -
  506. //==============================================================================
  507. /** Checks whether the file actually exists.
  508. diff --git a/source/modules/water/memory/HeapBlock.h b/source/modules/water/memory/HeapBlock.h
  509. index b8c232e11..98656e872 100644
  510. --- a/source/modules/water/memory/HeapBlock.h
  511. +++ b/source/modules/water/memory/HeapBlock.h
  512. @@ -94,20 +94,6 @@ public:
  513. std::free (data);
  514. }
  515. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  516. - HeapBlock (HeapBlock&& other) noexcept
  517. - : data (other.data)
  518. - {
  519. - other.data = nullptr;
  520. - }
  521. -
  522. - HeapBlock& operator= (HeapBlock&& other) noexcept
  523. - {
  524. - std::swap (data, other.data);
  525. - return *this;
  526. - }
  527. - #endif
  528. -
  529. //==============================================================================
  530. /** Returns a raw pointer to the allocated data.
  531. This may be a null pointer if the data hasn't yet been allocated, or if it has been
  532. diff --git a/source/modules/water/memory/MemoryBlock.cpp b/source/modules/water/memory/MemoryBlock.cpp
  533. index 6e83b8dfc..8b380da88 100644
  534. --- a/source/modules/water/memory/MemoryBlock.cpp
  535. +++ b/source/modules/water/memory/MemoryBlock.cpp
  536. @@ -87,22 +87,6 @@ MemoryBlock& MemoryBlock::operator= (const MemoryBlock& other)
  537. return *this;
  538. }
  539. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  540. -MemoryBlock::MemoryBlock (MemoryBlock&& other) noexcept
  541. - : data (static_cast<HeapBlock<char>&&> (other.data)),
  542. - size (other.size)
  543. -{
  544. -}
  545. -
  546. -MemoryBlock& MemoryBlock::operator= (MemoryBlock&& other) noexcept
  547. -{
  548. - data = static_cast<HeapBlock<char>&&> (other.data);
  549. - size = other.size;
  550. - return *this;
  551. -}
  552. -#endif
  553. -
  554. -
  555. //==============================================================================
  556. bool MemoryBlock::operator== (const MemoryBlock& other) const noexcept
  557. {
  558. diff --git a/source/modules/water/memory/MemoryBlock.h b/source/modules/water/memory/MemoryBlock.h
  559. index 4383139d6..701120cfa 100644
  560. --- a/source/modules/water/memory/MemoryBlock.h
  561. +++ b/source/modules/water/memory/MemoryBlock.h
  562. @@ -68,11 +68,6 @@ public:
  563. */
  564. MemoryBlock& operator= (const MemoryBlock&);
  565. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  566. - MemoryBlock (MemoryBlock&&) noexcept;
  567. - MemoryBlock& operator= (MemoryBlock&&) noexcept;
  568. - #endif
  569. -
  570. //==============================================================================
  571. /** Compares two memory blocks.
  572. @returns true only if the two blocks are the same size and have identical contents.
  573. diff --git a/source/modules/water/memory/ReferenceCountedObject.h b/source/modules/water/memory/ReferenceCountedObject.h
  574. index 4f5a256ee..b23ed914d 100644
  575. --- a/source/modules/water/memory/ReferenceCountedObject.h
  576. +++ b/source/modules/water/memory/ReferenceCountedObject.h
  577. @@ -301,22 +301,6 @@ public:
  578. return *this;
  579. }
  580. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  581. - /** Takes-over the object from another pointer. */
  582. - ReferenceCountedObjectPtr (ReferenceCountedObjectPtr&& other) noexcept
  583. - : referencedObject (other.referencedObject)
  584. - {
  585. - other.referencedObject = nullptr;
  586. - }
  587. -
  588. - /** Takes-over the object from another pointer. */
  589. - ReferenceCountedObjectPtr& operator= (ReferenceCountedObjectPtr&& other)
  590. - {
  591. - std::swap (referencedObject, other.referencedObject);
  592. - return *this;
  593. - }
  594. - #endif
  595. -
  596. /** Destructor.
  597. This will decrement the object's reference-count, which will cause the
  598. object to be deleted when the ref-count hits zero.
  599. diff --git a/source/modules/water/midi/MidiMessage.cpp b/source/modules/water/midi/MidiMessage.cpp
  600. index 21c90f508..a4354222e 100644
  601. --- a/source/modules/water/midi/MidiMessage.cpp
  602. +++ b/source/modules/water/midi/MidiMessage.cpp
  603. @@ -286,24 +286,6 @@ MidiMessage& MidiMessage::operator= (const MidiMessage& other)
  604. return *this;
  605. }
  606. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  607. -MidiMessage::MidiMessage (MidiMessage&& other) noexcept
  608. - : timeStamp (other.timeStamp), size (other.size)
  609. -{
  610. - packedData.allocatedData = other.packedData.allocatedData;
  611. - other.size = 0;
  612. -}
  613. -
  614. -MidiMessage& MidiMessage::operator= (MidiMessage&& other) noexcept
  615. -{
  616. - packedData.allocatedData = other.packedData.allocatedData;
  617. - timeStamp = other.timeStamp;
  618. - size = other.size;
  619. - other.size = 0;
  620. - return *this;
  621. -}
  622. -#endif
  623. -
  624. MidiMessage::~MidiMessage() noexcept
  625. {
  626. if (isHeapAllocated())
  627. diff --git a/source/modules/water/midi/MidiMessage.h b/source/modules/water/midi/MidiMessage.h
  628. index 07f15c467..6b78d55f8 100644
  629. --- a/source/modules/water/midi/MidiMessage.h
  630. +++ b/source/modules/water/midi/MidiMessage.h
  631. @@ -113,11 +113,6 @@ public:
  632. /** Copies this message from another one. */
  633. MidiMessage& operator= (const MidiMessage& other);
  634. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  635. - MidiMessage (MidiMessage&&) noexcept;
  636. - MidiMessage& operator= (MidiMessage&&) noexcept;
  637. - #endif
  638. -
  639. //==============================================================================
  640. /** Returns a pointer to the raw midi data.
  641. @see getRawDataSize
  642. diff --git a/source/modules/water/midi/MidiMessageSequence.h b/source/modules/water/midi/MidiMessageSequence.h
  643. index f85f5fd05..bfe27d061 100644
  644. --- a/source/modules/water/midi/MidiMessageSequence.h
  645. +++ b/source/modules/water/midi/MidiMessageSequence.h
  646. @@ -55,18 +55,6 @@ public:
  647. /** Replaces this sequence with another one. */
  648. MidiMessageSequence& operator= (const MidiMessageSequence&);
  649. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  650. - MidiMessageSequence (MidiMessageSequence&& other) noexcept
  651. - : list (static_cast<OwnedArray<MidiEventHolder>&&> (other.list))
  652. - {}
  653. -
  654. - MidiMessageSequence& operator= (MidiMessageSequence&& other) noexcept
  655. - {
  656. - list = static_cast<OwnedArray<MidiEventHolder>&&> (other.list);
  657. - return *this;
  658. - }
  659. - #endif
  660. -
  661. /** Destructor. */
  662. ~MidiMessageSequence();
  663. diff --git a/source/modules/water/misc/Result.cpp b/source/modules/water/misc/Result.cpp
  664. index b8706e771..49f1f85e1 100644
  665. --- a/source/modules/water/misc/Result.cpp
  666. +++ b/source/modules/water/misc/Result.cpp
  667. @@ -45,19 +45,6 @@ Result& Result::operator= (const Result& other)
  668. return *this;
  669. }
  670. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  671. -Result::Result (Result&& other) noexcept
  672. - : errorMessage (static_cast<String&&> (other.errorMessage))
  673. -{
  674. -}
  675. -
  676. -Result& Result::operator= (Result&& other) noexcept
  677. -{
  678. - errorMessage = static_cast<String&&> (other.errorMessage);
  679. - return *this;
  680. -}
  681. -#endif
  682. -
  683. bool Result::operator== (const Result& other) const noexcept
  684. {
  685. return errorMessage == other.errorMessage;
  686. diff --git a/source/modules/water/misc/Result.h b/source/modules/water/misc/Result.h
  687. index ab4cf9bf1..495a19fc9 100644
  688. --- a/source/modules/water/misc/Result.h
  689. +++ b/source/modules/water/misc/Result.h
  690. @@ -100,11 +100,6 @@ public:
  691. Result (const Result&);
  692. Result& operator= (const Result&);
  693. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  694. - Result (Result&&) noexcept;
  695. - Result& operator= (Result&&) noexcept;
  696. - #endif
  697. -
  698. bool operator== (const Result& other) const noexcept;
  699. bool operator!= (const Result& other) const noexcept;
  700. diff --git a/source/modules/water/text/Identifier.cpp b/source/modules/water/text/Identifier.cpp
  701. index e542d6eeb..3f1850369 100644
  702. --- a/source/modules/water/text/Identifier.cpp
  703. +++ b/source/modules/water/text/Identifier.cpp
  704. @@ -32,16 +32,6 @@ Identifier::~Identifier() noexcept {}
  705. Identifier::Identifier (const Identifier& other) noexcept : name (other.name) {}
  706. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  707. -Identifier::Identifier (Identifier&& other) noexcept : name (static_cast<String&&> (other.name)) {}
  708. -
  709. -Identifier& Identifier::operator= (Identifier&& other) noexcept
  710. -{
  711. - name = static_cast<String&&> (other.name);
  712. - return *this;
  713. -}
  714. -#endif
  715. -
  716. Identifier& Identifier::operator= (const Identifier& other) noexcept
  717. {
  718. name = other.name;
  719. diff --git a/source/modules/water/text/Identifier.h b/source/modules/water/text/Identifier.h
  720. index a044b3a3a..ab768cd10 100644
  721. --- a/source/modules/water/text/Identifier.h
  722. +++ b/source/modules/water/text/Identifier.h
  723. @@ -70,14 +70,6 @@ public:
  724. /** Creates a copy of another identifier. */
  725. Identifier& operator= (const Identifier& other) noexcept;
  726. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  727. - /** Creates a copy of another identifier. */
  728. - Identifier (Identifier&& other) noexcept;
  729. -
  730. - /** Creates a copy of another identifier. */
  731. - Identifier& operator= (Identifier&& other) noexcept;
  732. - #endif
  733. -
  734. /** Destructor */
  735. ~Identifier() noexcept;
  736. diff --git a/source/modules/water/text/String.cpp b/source/modules/water/text/String.cpp
  737. index 51b20bc25..1dd593468 100644
  738. --- a/source/modules/water/text/String.cpp
  739. +++ b/source/modules/water/text/String.cpp
  740. @@ -247,19 +247,6 @@ String& String::operator= (const String& other) noexcept
  741. return *this;
  742. }
  743. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  744. -String::String (String&& other) noexcept : text (other.text)
  745. -{
  746. - other.text = &(emptyString.text);
  747. -}
  748. -
  749. -String& String::operator= (String&& other) noexcept
  750. -{
  751. - std::swap (text, other.text);
  752. - return *this;
  753. -}
  754. -#endif
  755. -
  756. inline String::PreallocationBytes::PreallocationBytes (const size_t num) noexcept : numBytes (num) {}
  757. String::String (const PreallocationBytes& preallocationSize)
  758. diff --git a/source/modules/water/text/String.h b/source/modules/water/text/String.h
  759. index 0a0ba99f1..ffa8ecf3b 100644
  760. --- a/source/modules/water/text/String.h
  761. +++ b/source/modules/water/text/String.h
  762. @@ -56,10 +56,6 @@ public:
  763. /** Creates a copy of another string. */
  764. String (const String& other) noexcept;
  765. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  766. - String (String&& other) noexcept;
  767. - #endif
  768. -
  769. /** Creates a string from a zero-terminated ascii text string.
  770. The string passed-in must not contain any characters with a value above 127, because
  771. @@ -139,10 +135,6 @@ public:
  772. /** Replaces this string's contents with another string. */
  773. String& operator= (const String& other) noexcept;
  774. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  775. - String& operator= (String&& other) noexcept;
  776. - #endif
  777. -
  778. /** Appends another string at the end of this one. */
  779. String& operator+= (const String& stringToAppend);
  780. /** Appends another string at the end of this one. */
  781. diff --git a/source/modules/water/text/StringArray.cpp b/source/modules/water/text/StringArray.cpp
  782. index c0fddb5db..36856f4a7 100644
  783. --- a/source/modules/water/text/StringArray.cpp
  784. +++ b/source/modules/water/text/StringArray.cpp
  785. @@ -36,13 +36,6 @@ StringArray::StringArray (const StringArray& other)
  786. {
  787. }
  788. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  789. -StringArray::StringArray (StringArray&& other) noexcept
  790. - : strings (static_cast<Array <String>&&> (other.strings))
  791. -{
  792. -}
  793. -#endif
  794. -
  795. StringArray::StringArray (const String& firstValue)
  796. {
  797. strings.add (firstValue);
  798. @@ -69,14 +62,6 @@ StringArray& StringArray::operator= (const StringArray& other)
  799. return *this;
  800. }
  801. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  802. -StringArray& StringArray::operator= (StringArray&& other) noexcept
  803. -{
  804. - strings = static_cast<Array<String>&&> (other.strings);
  805. - return *this;
  806. -}
  807. -#endif
  808. -
  809. StringArray::~StringArray()
  810. {
  811. }
  812. @@ -125,13 +110,6 @@ bool StringArray::add (const String& newString)
  813. return strings.add (newString);
  814. }
  815. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  816. -bool StringArray::add (String&& stringToAdd)
  817. -{
  818. - return strings.add (static_cast<String&&> (stringToAdd));
  819. -}
  820. -#endif
  821. -
  822. bool StringArray::insert (const int index, const String& newString)
  823. {
  824. return strings.insert (index, newString);
  825. diff --git a/source/modules/water/text/StringArray.h b/source/modules/water/text/StringArray.h
  826. index 57ed5d300..d7244a066 100644
  827. --- a/source/modules/water/text/StringArray.h
  828. +++ b/source/modules/water/text/StringArray.h
  829. @@ -47,10 +47,6 @@ public:
  830. /** Creates a copy of another string array */
  831. StringArray (const StringArray&);
  832. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  833. - StringArray (StringArray&&) noexcept;
  834. - #endif
  835. -
  836. /** Creates an array containing a single string. */
  837. explicit StringArray (const String& firstValue);
  838. @@ -80,10 +76,6 @@ public:
  839. /** Copies the contents of another string array into this one */
  840. StringArray& operator= (const StringArray&);
  841. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  842. - StringArray& operator= (StringArray&&) noexcept;
  843. - #endif
  844. -
  845. /** Swaps the contents of this and another StringArray. */
  846. void swapWith (StringArray&) noexcept;
  847. @@ -159,11 +151,6 @@ public:
  848. /** Appends a string at the end of the array. */
  849. bool add (const String& stringToAdd);
  850. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  851. - /** Appends a string at the end of the array. */
  852. - bool add (String&& stringToAdd);
  853. - #endif
  854. -
  855. /** Inserts a string into the array.
  856. This will insert a string into the array at the given index, moving
  857. diff --git a/source/modules/water/water.h b/source/modules/water/water.h
  858. index 33b908c27..d8305a0ee 100644
  859. --- a/source/modules/water/water.h
  860. +++ b/source/modules/water/water.h
  861. @@ -32,18 +32,12 @@
  862. // Compiler support
  863. #if (__cplusplus >= 201103L || defined (__GXX_EXPERIMENTAL_CXX0X__)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
  864. - #define WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS 1
  865. -
  866. #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && ! defined (WATER_DELETED_FUNCTION)
  867. #define WATER_DELETED_FUNCTION = delete
  868. #endif
  869. #endif
  870. #ifdef __clang__
  871. - #if __has_feature (cxx_implicit_moves) && __clang_major__ >= 9
  872. - #define WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS 1
  873. - #endif
  874. -
  875. #if __has_feature (cxx_deleted_functions)
  876. #define WATER_DELETED_FUNCTION = delete
  877. #endif
  878. diff --git a/source/modules/water/xml/XmlElement.cpp b/source/modules/water/xml/XmlElement.cpp
  879. index 2de0fa34e..92bfecc7e 100644
  880. --- a/source/modules/water/xml/XmlElement.cpp
  881. +++ b/source/modules/water/xml/XmlElement.cpp
  882. @@ -133,31 +133,6 @@ XmlElement& XmlElement::operator= (const XmlElement& other)
  883. return *this;
  884. }
  885. -#if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  886. -XmlElement::XmlElement (XmlElement&& other) noexcept
  887. - : nextListItem (static_cast<LinkedListPointer<XmlElement>&&> (other.nextListItem)),
  888. - firstChildElement (static_cast<LinkedListPointer<XmlElement>&&> (other.firstChildElement)),
  889. - attributes (static_cast<LinkedListPointer<XmlAttributeNode>&&> (other.attributes)),
  890. - tagName (static_cast<String&&> (other.tagName))
  891. -{
  892. -}
  893. -
  894. -XmlElement& XmlElement::operator= (XmlElement&& other) noexcept
  895. -{
  896. - wassert (this != &other); // hopefully the compiler should make this situation impossible!
  897. -
  898. - removeAllAttributes();
  899. - deleteAllChildElements();
  900. -
  901. - nextListItem = static_cast<LinkedListPointer<XmlElement>&&> (other.nextListItem);
  902. - firstChildElement = static_cast<LinkedListPointer<XmlElement>&&> (other.firstChildElement);
  903. - attributes = static_cast<LinkedListPointer<XmlAttributeNode>&&> (other.attributes);
  904. - tagName = static_cast<String&&> (other.tagName);
  905. -
  906. - return *this;
  907. -}
  908. -#endif
  909. -
  910. void XmlElement::copyChildrenAndAttributesFrom (const XmlElement& other)
  911. {
  912. wassert (firstChildElement.get() == nullptr);
  913. diff --git a/source/modules/water/xml/XmlElement.h b/source/modules/water/xml/XmlElement.h
  914. index d27b7d98d..273d28e4c 100644
  915. --- a/source/modules/water/xml/XmlElement.h
  916. +++ b/source/modules/water/xml/XmlElement.h
  917. @@ -166,11 +166,6 @@ public:
  918. /** Creates a (deep) copy of another element. */
  919. XmlElement& operator= (const XmlElement&);
  920. - #if WATER_COMPILER_SUPPORTS_MOVE_SEMANTICS
  921. - XmlElement (XmlElement&&) noexcept;
  922. - XmlElement& operator= (XmlElement&&) noexcept;
  923. - #endif
  924. -
  925. /** Deleting an XmlElement will also delete all of its child elements. */
  926. ~XmlElement() noexcept;