diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile index a7943fe21c..6fbfec64a3 100644 --- a/doxygen/Doxyfile +++ b/doxygen/Doxyfile @@ -2055,8 +2055,6 @@ PREDEFINED = WIN32=1 \ JUCE_LINUX=1 \ DOXYGEN=1 \ JUCE_COMPILER_SUPPORTS_NOEXCEPT=1 \ - JUCE_COMPILER_SUPPORTS_NULLPTR=1 \ - JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS=1 \ JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS=1 \ JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES=1 \ JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL=1 \ diff --git a/examples/Demo/Source/Demos/FlexBoxDemo.cpp b/examples/Demo/Source/Demos/FlexBoxDemo.cpp index 6d15e36115..a523610bcb 100644 --- a/examples/Demo/Source/Demos/FlexBoxDemo.cpp +++ b/examples/Demo/Source/Demos/FlexBoxDemo.cpp @@ -25,7 +25,7 @@ #include "../JuceDemoHeader.h" // these classes are C++11-only -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS && JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS && JUCE_COMPILER_SUPPORTS_LAMBDAS +#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS && JUCE_COMPILER_SUPPORTS_LAMBDAS struct DemoFlexPanel : public juce::Component, private juce::TextEditor::Listener, diff --git a/extras/BLOCKS/doxygen/Doxyfile b/extras/BLOCKS/doxygen/Doxyfile index db08ea7780..9729e672ef 100644 --- a/extras/BLOCKS/doxygen/Doxyfile +++ b/extras/BLOCKS/doxygen/Doxyfile @@ -2066,8 +2066,6 @@ PREDEFINED = WIN32=1 \ JUCE_LINUX=1 \ DOXYGEN=1 \ JUCE_COMPILER_SUPPORTS_NOEXCEPT=1 \ - JUCE_COMPILER_SUPPORTS_NULLPTR=1 \ - JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS=1 \ JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS=1 \ JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES=1 \ JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL=1 \ diff --git a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h index ad6250586e..72a8268d1f 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h +++ b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h @@ -371,7 +371,7 @@ public: { // If you're using interleaved data, call the other constructor! If you're using non-interleaved data, // you should pass NonInterleaved as the template parameter for the interleaving type! - static_jassert (InterleavingType::isInterleavedType == 0); + static_assert (InterleavingType::isInterleavedType == 0, "Incorrect constructor for interleaved data"); } /** Creates a pointer from some raw data in the appropriate format with the specified number of interleaved channels. @@ -411,7 +411,8 @@ public: */ inline void setAsFloat (float newValue) noexcept { - static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + static_assert (Constness::isConst == 0, "Attempt to write to a const pointer"); Endianness::setAsFloat (data, newValue); } @@ -428,7 +429,8 @@ public: */ inline void setAsInt32 (int32 newValue) noexcept { - static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + static_assert (Constness::isConst == 0, "Attempt to write to a const pointer"); Endianness::setAsInt32 (data, newValue); } @@ -446,7 +448,8 @@ public: */ void convertSamples (Pointer source, int numSamples) const noexcept { - static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + static_assert (Constness::isConst == 0, "Attempt to write to a const pointer"); for (Pointer dest (*this); --numSamples >= 0;) { @@ -462,7 +465,8 @@ public: template void convertSamples (OtherPointerType source, int numSamples) const noexcept { - static_jassert (Constness::isConst == 0); // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + // trying to write to a const pointer! For a writeable one, use AudioData::NonConst instead! + static_assert (Constness::isConst == 0, "Attempt to write to a const pointer"); Pointer dest (*this); diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h index 0d17f25cfb..e688ffff1f 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h +++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h @@ -190,7 +190,6 @@ public: */ ~AudioBuffer() noexcept {} - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS /** Move constructor */ AudioBuffer (AudioBuffer&& other) noexcept : numChannels (other.numChannels), @@ -221,7 +220,6 @@ public: other.allocatedBytes = 0; return *this; } - #endif //============================================================================== /** Returns the number of channels of audio data that this buffer contains. diff --git a/modules/juce_audio_basics/midi/juce_MidiMessage.cpp b/modules/juce_audio_basics/midi/juce_MidiMessage.cpp index 2c683516cf..11b9a0c726 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessage.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiMessage.cpp @@ -285,7 +285,6 @@ MidiMessage& MidiMessage::operator= (const MidiMessage& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS MidiMessage::MidiMessage (MidiMessage&& other) noexcept : timeStamp (other.timeStamp), size (other.size) { @@ -301,7 +300,6 @@ MidiMessage& MidiMessage::operator= (MidiMessage&& other) noexcept other.size = 0; return *this; } -#endif MidiMessage::~MidiMessage() noexcept { diff --git a/modules/juce_audio_basics/midi/juce_MidiMessage.h b/modules/juce_audio_basics/midi/juce_MidiMessage.h index d091154125..08af27dc79 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessage.h +++ b/modules/juce_audio_basics/midi/juce_MidiMessage.h @@ -115,10 +115,11 @@ public: /** Copies this message from another one. */ MidiMessage& operator= (const MidiMessage& other); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ MidiMessage (MidiMessage&&) noexcept; + + /** Move assignment operator */ MidiMessage& operator= (MidiMessage&&) noexcept; - #endif //============================================================================== /** Returns a pointer to the raw midi data. diff --git a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h index 92e38db88b..2f4f4f02b2 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h +++ b/modules/juce_audio_basics/midi/juce_MidiMessageSequence.h @@ -54,17 +54,17 @@ public: /** Replaces this sequence with another one. */ MidiMessageSequence& operator= (const MidiMessageSequence&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ MidiMessageSequence (MidiMessageSequence&& other) noexcept : list (static_cast&&> (other.list)) {} + /** Move assignment operator */ MidiMessageSequence& operator= (MidiMessageSequence&& other) noexcept { list = static_cast&&> (other.list); return *this; } - #endif /** Destructor. */ ~MidiMessageSequence(); diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 8d778e37c7..b1aa1400ef 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -84,14 +84,12 @@ public: new (data.elements + i) ElementType (other.data.elements[i]); } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Array (Array&& other) noexcept : data (static_cast&&> (other.data)), numUsed (other.numUsed) { other.numUsed = 0; } - #endif /** Initalises from a null-terminated C array of values. @@ -146,7 +144,6 @@ public: return *this; } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Array& operator= (Array&& other) noexcept { const ScopedLockType lock (getLock()); @@ -156,7 +153,6 @@ public: other.numUsed = 0; return *this; } - #endif //============================================================================== /** Compares this array to another one. @@ -403,7 +399,6 @@ public: new (data.elements + numUsed++) ElementType (newElement); } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS /** Appends a new element at the end of the array. @param newElement the new object to add to the array @@ -415,7 +410,6 @@ public: data.ensureAllocatedSize (numUsed + 1); new (data.elements + numUsed++) ElementType (static_cast (newElement)); } - #endif /** Inserts a new element into the array at a given position. diff --git a/modules/juce_core/containers/juce_ArrayAllocationBase.h b/modules/juce_core/containers/juce_ArrayAllocationBase.h index 40b33a0268..eed03c47e3 100644 --- a/modules/juce_core/containers/juce_ArrayAllocationBase.h +++ b/modules/juce_core/containers/juce_ArrayAllocationBase.h @@ -60,7 +60,6 @@ public: { } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS ArrayAllocationBase (ArrayAllocationBase&& other) noexcept : elements (static_cast&&> (other.elements)), numAllocated (other.numAllocated) @@ -73,7 +72,6 @@ public: numAllocated = other.numAllocated; return *this; } - #endif //============================================================================== /** Changes the amount of storage allocated. diff --git a/modules/juce_core/containers/juce_LinkedListPointer.h b/modules/juce_core/containers/juce_LinkedListPointer.h index 9581992af3..5345d450e1 100644 --- a/modules/juce_core/containers/juce_LinkedListPointer.h +++ b/modules/juce_core/containers/juce_LinkedListPointer.h @@ -83,7 +83,6 @@ public: return *this; } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS LinkedListPointer (LinkedListPointer&& other) noexcept : item (other.item) { @@ -98,7 +97,6 @@ public: other.item = nullptr; return *this; } - #endif //============================================================================== /** Returns the item which this pointer points to. */ diff --git a/modules/juce_core/containers/juce_NamedValueSet.cpp b/modules/juce_core/containers/juce_NamedValueSet.cpp index e539437938..b8c16ae082 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.cpp +++ b/modules/juce_core/containers/juce_NamedValueSet.cpp @@ -45,7 +45,6 @@ NamedValueSet& NamedValueSet::operator= (const NamedValueSet& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS NamedValueSet::NamedValueSet (NamedValueSet&& other) noexcept : values (static_cast&&> (other.values)) { @@ -56,7 +55,6 @@ NamedValueSet& NamedValueSet::operator= (NamedValueSet&& other) noexcept other.values.swapWith (values); return *this; } -#endif NamedValueSet::~NamedValueSet() noexcept { @@ -122,7 +120,6 @@ var* NamedValueSet::getVarPointer (const Identifier& name) const noexcept return nullptr; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS bool NamedValueSet::set (const Identifier& name, var&& newValue) { if (var* const v = getVarPointer (name)) @@ -137,7 +134,6 @@ bool NamedValueSet::set (const Identifier& name, var&& newValue) values.add (NamedValue (name, static_cast (newValue))); return true; } -#endif bool NamedValueSet::set (const Identifier& name, const var& newValue) { diff --git a/modules/juce_core/containers/juce_NamedValueSet.h b/modules/juce_core/containers/juce_NamedValueSet.h index 87dec87a4e..273da2ebae 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.h +++ b/modules/juce_core/containers/juce_NamedValueSet.h @@ -50,10 +50,11 @@ public: /** Replaces this set with a copy of another set. */ NamedValueSet& operator= (const NamedValueSet&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ NamedValueSet (NamedValueSet&&) noexcept; + + /** Move assignment operator */ NamedValueSet& operator= (NamedValueSet&&) noexcept; - #endif /** Destructor. */ ~NamedValueSet() noexcept; @@ -68,7 +69,6 @@ public: NamedValue (const Identifier& n, const var& v) : name (n), value (v) {} NamedValue (const NamedValue& other) : name (other.name), value (other.value) {} - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS NamedValue (NamedValue&& other) noexcept : name (static_cast (other.name)), value (static_cast (other.value)) @@ -87,7 +87,6 @@ public: value = static_cast (other.value); return *this; } - #endif bool operator== (const NamedValue& other) const noexcept { return name == other.name && value == other.value; } bool operator!= (const NamedValue& other) const noexcept { return ! operator== (other); } @@ -124,13 +123,11 @@ public: */ bool set (const Identifier& name, const var& newValue); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS /** Changes or adds a named value. @returns true if a value was changed or added; false if the value was already set the value passed-in. */ bool set (const Identifier& name, var&& newValue); - #endif /** Returns true if the set contains an item with the specified name. */ bool contains (const Identifier& name) const noexcept; diff --git a/modules/juce_core/containers/juce_OwnedArray.h b/modules/juce_core/containers/juce_OwnedArray.h index a677ae5d94..9f5461ca09 100644 --- a/modules/juce_core/containers/juce_OwnedArray.h +++ b/modules/juce_core/containers/juce_OwnedArray.h @@ -74,7 +74,7 @@ public: deleteAllObjects(); } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ OwnedArray (OwnedArray&& other) noexcept : data (static_cast&&> (other.data)), numUsed (other.numUsed) @@ -82,6 +82,7 @@ public: other.numUsed = 0; } + /** Move assignment operator */ OwnedArray& operator= (OwnedArray&& other) noexcept { const ScopedLockType lock (getLock()); @@ -92,7 +93,6 @@ public: other.numUsed = 0; return *this; } - #endif //============================================================================== /** Clears the array, optionally deleting the objects inside it first. */ diff --git a/modules/juce_core/containers/juce_Variant.cpp b/modules/juce_core/containers/juce_Variant.cpp index 04a82f8c4e..b61ba6883e 100644 --- a/modules/juce_core/containers/juce_Variant.cpp +++ b/modules/juce_core/containers/juce_Variant.cpp @@ -358,9 +358,7 @@ public: struct RefCountedArray : public ReferenceCountedObject { RefCountedArray (const Array& a) : array (a) { incReferenceCount(); } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS RefCountedArray (Array&& a) : array (static_cast&&> (a)) { incReferenceCount(); } - #endif Array array; }; }; @@ -527,7 +525,6 @@ var& var::operator= (const Array& v) { var v2 (v); swapWith (v2); re var& var::operator= (ReferenceCountedObject* v) { var v2 (v); swapWith (v2); return *this; } var& var::operator= (NativeFunction v) { var v2 (v); swapWith (v2); return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS var::var (var&& other) noexcept : type (other.type), value (other.value) @@ -563,7 +560,6 @@ var& var::operator= (String&& v) new (value.stringValue) String (static_cast (v)); return *this; } -#endif //============================================================================== bool var::equals (const var& other) const noexcept diff --git a/modules/juce_core/containers/juce_Variant.h b/modules/juce_core/containers/juce_Variant.h index 071f0a45ad..dfc6cd0f07 100644 --- a/modules/juce_core/containers/juce_Variant.h +++ b/modules/juce_core/containers/juce_Variant.h @@ -109,14 +109,12 @@ public: var& operator= (ReferenceCountedObject* object); var& operator= (NativeFunction method); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS var (var&&) noexcept; var (String&&); var (MemoryBlock&&); var (Array&&); var& operator= (var&&) noexcept; var& operator= (String&&); - #endif void swapWith (var& other) noexcept; diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 9b99a95c36..d0b47f9068 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -57,7 +57,6 @@ File& File::operator= (const File& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS File::File (File&& other) noexcept : fullPath (static_cast (other.fullPath)) { @@ -68,7 +67,6 @@ File& File::operator= (File&& other) noexcept fullPath = static_cast (other.fullPath); return *this; } -#endif #if JUCE_ALLOW_STATIC_NULL_VARIABLES const File File::nonexistent; diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index f469124edb..341cf94d9d 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -90,10 +90,11 @@ public: /** Copies from another file object. */ File& operator= (const File& otherFile); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ File (File&&) noexcept; + + /** Move assignment operator */ File& operator= (File&&) noexcept; - #endif //============================================================================== #if JUCE_ALLOW_STATIC_NULL_VARIABLES diff --git a/modules/juce_core/maths/juce_BigInteger.cpp b/modules/juce_core/maths/juce_BigInteger.cpp index fa973a4be6..16b51720dc 100644 --- a/modules/juce_core/maths/juce_BigInteger.cpp +++ b/modules/juce_core/maths/juce_BigInteger.cpp @@ -119,7 +119,6 @@ BigInteger::BigInteger (const BigInteger& other) memcpy (getValues(), other.getValues(), sizeof (uint32) * allocatedSize); } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS BigInteger::BigInteger (BigInteger&& other) noexcept : heapAllocation (static_cast&&> (other.heapAllocation)), allocatedSize (other.allocatedSize), @@ -138,7 +137,6 @@ BigInteger& BigInteger::operator= (BigInteger&& other) noexcept negative = other.negative; return *this; } -#endif BigInteger::~BigInteger() { diff --git a/modules/juce_core/maths/juce_BigInteger.h b/modules/juce_core/maths/juce_BigInteger.h index e832377c0f..d1f3fc09e3 100644 --- a/modules/juce_core/maths/juce_BigInteger.h +++ b/modules/juce_core/maths/juce_BigInteger.h @@ -69,10 +69,11 @@ public: /** Creates a copy of another BigInteger. */ BigInteger (const BigInteger&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ BigInteger (BigInteger&&) noexcept; + + /** Move assignment operator */ BigInteger& operator= (BigInteger&&) noexcept; - #endif /** Destructor. */ ~BigInteger(); diff --git a/modules/juce_core/maths/juce_Expression.cpp b/modules/juce_core/maths/juce_Expression.cpp index 1f190f1631..31ff87b102 100644 --- a/modules/juce_core/maths/juce_Expression.cpp +++ b/modules/juce_core/maths/juce_Expression.cpp @@ -958,7 +958,6 @@ Expression& Expression::operator= (const Expression& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Expression::Expression (Expression&& other) noexcept : term (static_cast&&> (other.term)) { @@ -969,7 +968,6 @@ Expression& Expression::operator= (Expression&& other) noexcept term = static_cast&&> (other.term); return *this; } -#endif Expression::Expression (const String& stringToParse, String& parseError) { diff --git a/modules/juce_core/maths/juce_Expression.h b/modules/juce_core/maths/juce_Expression.h index a79a3e716a..6ddc91ec1b 100644 --- a/modules/juce_core/maths/juce_Expression.h +++ b/modules/juce_core/maths/juce_Expression.h @@ -63,10 +63,11 @@ public: /** Copies another expression. */ Expression& operator= (const Expression&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ Expression (Expression&&) noexcept; + + /** Move assignment operator */ Expression& operator= (Expression&&) noexcept; - #endif /** Creates a simple expression with a specified constant value. */ explicit Expression (double constant); diff --git a/modules/juce_core/memory/juce_Atomic.h b/modules/juce_core/memory/juce_Atomic.h index 5a51f6cf44..78778428ee 100644 --- a/modules/juce_core/memory/juce_Atomic.h +++ b/modules/juce_core/memory/juce_Atomic.h @@ -64,8 +64,8 @@ public: /** Destructor. */ inline ~Atomic() noexcept { - // This class can only be used for types which are 32 or 64 bits in size. - static_jassert (sizeof (Type) == 4 || sizeof (Type) == 8); + static_assert (sizeof (Type) == 4 || sizeof (Type) == 8, + "Atomic can only be used for types which are 32 or 64 bits in size"); } /** Atomically reads and returns the current value. */ diff --git a/modules/juce_core/memory/juce_HeapBlock.h b/modules/juce_core/memory/juce_HeapBlock.h index 5f3a423a88..e213d696d4 100644 --- a/modules/juce_core/memory/juce_HeapBlock.h +++ b/modules/juce_core/memory/juce_HeapBlock.h @@ -137,19 +137,19 @@ public: std::free (data); } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ HeapBlock (HeapBlock&& other) noexcept : data (other.data) { other.data = nullptr; } + /** Move assignment operator */ HeapBlock& operator= (HeapBlock&& other) noexcept { std::swap (data, other.data); return *this; } - #endif //============================================================================== /** Returns a raw pointer to the allocated data. diff --git a/modules/juce_core/memory/juce_MemoryBlock.cpp b/modules/juce_core/memory/juce_MemoryBlock.cpp index 93b0255854..cb4a25c4db 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.cpp +++ b/modules/juce_core/memory/juce_MemoryBlock.cpp @@ -88,7 +88,6 @@ MemoryBlock& MemoryBlock::operator= (const MemoryBlock& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS MemoryBlock::MemoryBlock (MemoryBlock&& other) noexcept : data (static_cast&&> (other.data)), size (other.size) @@ -101,8 +100,6 @@ MemoryBlock& MemoryBlock::operator= (MemoryBlock&& other) noexcept size = other.size; return *this; } -#endif - //============================================================================== bool MemoryBlock::operator== (const MemoryBlock& other) const noexcept diff --git a/modules/juce_core/memory/juce_MemoryBlock.h b/modules/juce_core/memory/juce_MemoryBlock.h index 73426569fb..9c401a9d1d 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.h +++ b/modules/juce_core/memory/juce_MemoryBlock.h @@ -70,10 +70,11 @@ public: */ MemoryBlock& operator= (const MemoryBlock&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ MemoryBlock (MemoryBlock&&) noexcept; + + /** Move assignment operator */ MemoryBlock& operator= (MemoryBlock&&) noexcept; - #endif //============================================================================== /** Compares two memory blocks. diff --git a/modules/juce_core/memory/juce_ReferenceCountedObject.h b/modules/juce_core/memory/juce_ReferenceCountedObject.h index 485fed90bf..04f029f456 100644 --- a/modules/juce_core/memory/juce_ReferenceCountedObject.h +++ b/modules/juce_core/memory/juce_ReferenceCountedObject.h @@ -248,13 +248,11 @@ public: incIfNotNull (refCountedObject); } - #if JUCE_COMPILER_SUPPORTS_NULLPTR /** Creates a pointer to a null object. */ ReferenceCountedObjectPtr (decltype (nullptr)) noexcept : referencedObject (nullptr) { } - #endif /** Copies another pointer. This will increment the object's reference-count. @@ -312,7 +310,6 @@ public: return *this; } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS /** Takes-over the object from another pointer. */ ReferenceCountedObjectPtr (ReferenceCountedObjectPtr&& other) noexcept : referencedObject (other.referencedObject) @@ -326,7 +323,6 @@ public: std::swap (referencedObject, other.referencedObject); return *this; } - #endif /** Destructor. This will decrement the object's reference-count, which will cause the diff --git a/modules/juce_core/memory/juce_ScopedPointer.h b/modules/juce_core/memory/juce_ScopedPointer.h index 2dda066c3f..e921a78216 100644 --- a/modules/juce_core/memory/juce_ScopedPointer.h +++ b/modules/juce_core/memory/juce_ScopedPointer.h @@ -78,12 +78,10 @@ public: { } - #if JUCE_COMPILER_SUPPORTS_NULLPTR /** Creates a ScopedPointer containing a null pointer. */ inline ScopedPointer (decltype (nullptr)) noexcept : object (nullptr) { } - #endif /** Creates a ScopedPointer that owns the specified object. */ inline ScopedPointer (ObjectType* const objectToTakePossessionOf) noexcept @@ -153,13 +151,14 @@ public: return *this; } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Take ownership of another ScopedPointer */ ScopedPointer (ScopedPointer&& other) noexcept : object (other.object) { other.object = nullptr; } + /** Take ownership of another ScopedPointer */ ScopedPointer& operator= (ScopedPointer&& other) noexcept { ContainerDeletePolicy::destroy (object); @@ -167,7 +166,6 @@ public: other.object = nullptr; return *this; } - #endif //============================================================================== /** Returns the object that this ScopedPointer refers to. */ @@ -257,7 +255,8 @@ bool operator!= (const ScopedPointer& pointer1, ObjectType* const po #ifndef DOXYGEN // NB: This is just here to prevent any silly attempts to call deleteAndZero() on a ScopedPointer. template -void deleteAndZero (ScopedPointer&) { static_jassert (sizeof (Type) == 12345); } +void deleteAndZero (ScopedPointer&) { static_assert (sizeof (Type) == 12345, + "Attempt to call deleteAndZero() on a ScopedPointer"); } #endif #endif // JUCE_SCOPEDPOINTER_H_INCLUDED diff --git a/modules/juce_core/memory/juce_WeakReference.h b/modules/juce_core/memory/juce_WeakReference.h index 37e92d31ff..4d07887f9f 100644 --- a/modules/juce_core/memory/juce_WeakReference.h +++ b/modules/juce_core/memory/juce_WeakReference.h @@ -93,16 +93,17 @@ public: /** Creates a copy of another WeakReference. */ WeakReference (const WeakReference& other) noexcept : holder (other.holder) {} + /** Move constructor */ + WeakReference (WeakReference&& other) noexcept : holder (static_cast (other.holder)) {} + /** Copies another pointer to this one. */ WeakReference& operator= (const WeakReference& other) { holder = other.holder; return *this; } /** Copies another pointer to this one. */ WeakReference& operator= (ObjectType* const newObject) { holder = getRef (newObject); return *this; } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS - WeakReference (WeakReference&& other) noexcept : holder (static_cast (other.holder)) {} + /** Move assignment operator */ WeakReference& operator= (WeakReference&& other) noexcept { holder = static_cast (other.holder); return *this; } - #endif /** Returns the object that this pointer refers to, or null if the object no longer exists. */ ObjectType* get() const noexcept { return holder != nullptr ? holder->get() : nullptr; } diff --git a/modules/juce_core/misc/juce_Result.cpp b/modules/juce_core/misc/juce_Result.cpp index 243f2d1c5f..ce60cba4f0 100644 --- a/modules/juce_core/misc/juce_Result.cpp +++ b/modules/juce_core/misc/juce_Result.cpp @@ -46,7 +46,6 @@ Result& Result::operator= (const Result& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Result::Result (Result&& other) noexcept : errorMessage (static_cast (other.errorMessage)) { @@ -57,7 +56,6 @@ Result& Result::operator= (Result&& other) noexcept errorMessage = static_cast (other.errorMessage); return *this; } -#endif bool Result::operator== (const Result& other) const noexcept { diff --git a/modules/juce_core/misc/juce_Result.h b/modules/juce_core/misc/juce_Result.h index 4d047dd630..5737151c54 100644 --- a/modules/juce_core/misc/juce_Result.h +++ b/modules/juce_core/misc/juce_Result.h @@ -101,11 +101,8 @@ public: //============================================================================== Result (const Result&); Result& operator= (const Result&); - - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Result (Result&&) noexcept; Result& operator= (Result&&) noexcept; - #endif bool operator== (const Result& other) const noexcept; bool operator!= (const Result& other) const noexcept; diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 50629ad072..ed3ab2e8bc 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -42,7 +42,8 @@ namespace WindowsFileHelpers int64 fileTimeToTime (const FILETIME* const ft) { - static_jassert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME)); // tell me if this fails! + static_assert (sizeof (ULARGE_INTEGER) == sizeof (FILETIME), + "ULARGE_INTEGER is too small to hold FILETIME: please report!"); return (int64) ((reinterpret_cast (ft)->QuadPart - 116444736000000000LL) / 10000); } diff --git a/modules/juce_core/native/juce_win32_Threads.cpp b/modules/juce_core/native/juce_win32_Threads.cpp index 0bdc83e3ca..b08a0b39d4 100644 --- a/modules/juce_core/native/juce_win32_Threads.cpp +++ b/modules/juce_core/native/juce_win32_Threads.cpp @@ -41,7 +41,8 @@ void* getUser32Function (const char* functionName) CriticalSection::CriticalSection() noexcept { // (just to check the MS haven't changed this structure and broken things...) - static_jassert (sizeof (CRITICAL_SECTION) <= sizeof (lock)); + static_assert (sizeof (CRITICAL_SECTION) <= sizeof (lock), + "win32 lock array too small to hold CRITICAL_SECTION: please report this JUCE bug!"); InitializeCriticalSection ((CRITICAL_SECTION*) lock); } diff --git a/modules/juce_core/streams/juce_InputStream.cpp b/modules/juce_core/streams/juce_InputStream.cpp index f0b8390c3e..95be9a03be 100644 --- a/modules/juce_core/streams/juce_InputStream.cpp +++ b/modules/juce_core/streams/juce_InputStream.cpp @@ -134,8 +134,7 @@ int64 InputStream::readInt64BigEndian() float InputStream::readFloat() { - // the union below relies on these types being the same size... - static_jassert (sizeof (int32) == sizeof (float)); + static_assert (sizeof (int32) == sizeof (float), "Union assumes float has the same size as an int32"); union { int32 asInt; float asFloat; } n; n.asInt = (int32) readInt(); return n.asFloat; diff --git a/modules/juce_core/system/juce_CompilerSupport.h b/modules/juce_core/system/juce_CompilerSupport.h index 5864ceb88b..a4bc0dea51 100644 --- a/modules/juce_core/system/juce_CompilerSupport.h +++ b/modules/juce_core/system/juce_CompilerSupport.h @@ -40,11 +40,8 @@ // GCC #if (__cplusplus >= 201103L || defined (__GXX_EXPERIMENTAL_CXX0X__)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1 - #define JUCE_COMPILER_SUPPORTS_NULLPTR 1 - #define JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS 1 #define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1 #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1 - #define JUCE_COMPILER_SUPPORTS_STATIC_ASSERT 1 #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && ! defined (JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL) #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 @@ -68,18 +65,11 @@ //============================================================================== // Clang #if JUCE_CLANG && defined (__has_feature) - #if __has_feature (cxx_nullptr) - #define JUCE_COMPILER_SUPPORTS_NULLPTR 1 - #endif #if __has_feature (cxx_noexcept) #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1 #endif - #if __has_feature (cxx_rvalue_references) - #define JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS 1 - #endif - #if __has_feature (cxx_deleted_functions) #define JUCE_DELETED_FUNCTION = delete #endif @@ -96,10 +86,6 @@ #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1 #endif - #if __has_feature (cxx_static_assert) - #define JUCE_COMPILER_SUPPORTS_STATIC_ASSERT 1 - #endif - #if __has_feature (cxx_override_control) && (! defined (JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL)) #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 #endif @@ -119,11 +105,6 @@ //============================================================================== // MSVC #ifdef _MSC_VER - #if _MSC_VER >= 1600 - #define JUCE_COMPILER_SUPPORTS_NULLPTR 1 - #define JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS 1 - #define JUCE_COMPILER_SUPPORTS_STATIC_ASSERT 1 - #endif #if _MSC_VER >= 1700 #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 @@ -170,13 +151,6 @@ #endif #endif - #if ! JUCE_COMPILER_SUPPORTS_NULLPTR - #ifdef nullptr - #undef nullptr - #endif - #define nullptr (0) - #endif - #if ! JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL #undef override #define override diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 21d1a5b1c8..cd0fe95155 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -172,30 +172,6 @@ #define JUCE_STRINGIFY(item) JUCE_STRINGIFY_MACRO_HELPER (item) //============================================================================== -#if JUCE_COMPILER_SUPPORTS_STATIC_ASSERT - /** A compile-time assertion macro. - If the expression parameter is false, the macro will cause a compile error. (The actual error - message that the compiler generates may be completely bizarre and seem to have no relation to - the place where you put the static_assert though!) - */ - #define static_jassert(expression) static_assert(expression, #expression); -#else - #ifndef DOXYGEN - namespace juce - { - template struct JuceStaticAssert; - template <> struct JuceStaticAssert { static void dummy() {} }; - } - #endif - - /** A compile-time assertion macro. - If the expression parameter is false, the macro will cause a compile error. (The actual error - message that the compiler generates may be completely bizarre and seem to have no relation to - the place where you put the static_assert though!) - */ - #define static_jassert(expression) juce::JuceStaticAssert::dummy(); -#endif - /** This is a shorthand macro for declaring stubs for a class's copy constructor and operator=. For example, instead of diff --git a/modules/juce_core/system/juce_SystemStats.cpp b/modules/juce_core/system/juce_SystemStats.cpp index b67c444703..cd43dcb0e4 100644 --- a/modules/juce_core/system/juce_SystemStats.cpp +++ b/modules/juce_core/system/juce_SystemStats.cpp @@ -32,15 +32,15 @@ String SystemStats::getJUCEVersion() { // Some basic tests, to keep an eye on things and make sure these types work ok // on all platforms. Let me know if any of these assertions fail on your system! - static_jassert (sizeof (pointer_sized_int) == sizeof (void*)); - static_jassert (sizeof (int8) == 1); - static_jassert (sizeof (uint8) == 1); - static_jassert (sizeof (int16) == 2); - static_jassert (sizeof (uint16) == 2); - static_jassert (sizeof (int32) == 4); - static_jassert (sizeof (uint32) == 4); - static_jassert (sizeof (int64) == 8); - static_jassert (sizeof (uint64) == 8); + static_assert (sizeof (pointer_sized_int) == sizeof (void*), "Basic sanity test failed: please report!"); + static_assert (sizeof (int8) == 1, "Basic sanity test failed: please report!"); + static_assert (sizeof (uint8) == 1, "Basic sanity test failed: please report!"); + static_assert (sizeof (int16) == 2, "Basic sanity test failed: please report!"); + static_assert (sizeof (uint16) == 2, "Basic sanity test failed: please report!"); + static_assert (sizeof (int32) == 4, "Basic sanity test failed: please report!"); + static_assert (sizeof (uint32) == 4, "Basic sanity test failed: please report!"); + static_assert (sizeof (int64) == 8, "Basic sanity test failed: please report!"); + static_assert (sizeof (uint64) == 8, "Basic sanity test failed: please report!"); return "JUCE v" JUCE_STRINGIFY(JUCE_MAJOR_VERSION) "." JUCE_STRINGIFY(JUCE_MINOR_VERSION) diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index 1f898cab02..bcd06e8fbc 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -193,17 +193,21 @@ #ifdef __clang__ #define JUCE_CLANG 1 + + #if ((! __has_feature (cxx_nullptr)) || (! __has_feature (cxx_rvalue_references)) || (! __has_feature (cxx_static_assert))) + #error "Clang 3.2 and earlier are no longer supported!" + #endif #elif defined (__GNUC__) #define JUCE_GCC 1 + + #if (__cplusplus < 201103L && (! defined (__GXX_EXPERIMENTAL_CXX0X__))) || ((__GNUC__ * 100 + __GNUC_MINOR__) < 406) + #error "GCC 4.5 and earlier are no longer supported!" + #endif #elif defined (_MSC_VER) #define JUCE_MSVC 1 - #if _MSC_VER < 1500 - #define JUCE_VC8_OR_EARLIER 1 - - #if _MSC_VER < 1400 - #error "Visual Studio 2003 and earlier are no longer supported!" - #endif + #if _MSC_VER < 1600 + #error "Visual Studio 2008 and earlier are no longer supported!" #endif #else #error unknown compiler diff --git a/modules/juce_core/text/juce_Identifier.cpp b/modules/juce_core/text/juce_Identifier.cpp index a16d68caa4..843830d1a9 100644 --- a/modules/juce_core/text/juce_Identifier.cpp +++ b/modules/juce_core/text/juce_Identifier.cpp @@ -33,7 +33,6 @@ Identifier::~Identifier() noexcept {} Identifier::Identifier (const Identifier& other) noexcept : name (other.name) {} -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Identifier::Identifier (Identifier&& other) noexcept : name (static_cast (other.name)) {} Identifier& Identifier::operator= (Identifier&& other) noexcept @@ -41,7 +40,6 @@ Identifier& Identifier::operator= (Identifier&& other) noexcept name = static_cast (other.name); return *this; } -#endif Identifier& Identifier::operator= (const Identifier& other) noexcept { diff --git a/modules/juce_core/text/juce_Identifier.h b/modules/juce_core/text/juce_Identifier.h index 24b02375ee..9631d0d561 100644 --- a/modules/juce_core/text/juce_Identifier.h +++ b/modules/juce_core/text/juce_Identifier.h @@ -72,13 +72,11 @@ public: /** Creates a copy of another identifier. */ Identifier& operator= (const Identifier& other) noexcept; - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS /** Creates a copy of another identifier. */ Identifier (Identifier&& other) noexcept; /** Creates a copy of another identifier. */ Identifier& operator= (Identifier&& other) noexcept; - #endif /** Destructor */ ~Identifier() noexcept; diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 798f46f707..7410c0bf31 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -226,16 +226,17 @@ private: { // Let me know if any of these assertions fail on your system! #if JUCE_NATIVE_WCHAR_IS_UTF8 - static_jassert (sizeof (wchar_t) == 1); + static_assert (sizeof (wchar_t) == 1, "JUCE_NATIVE_WCHAR_IS_* macro has incorrect value"); #elif JUCE_NATIVE_WCHAR_IS_UTF16 - static_jassert (sizeof (wchar_t) == 2); + static_assert (sizeof (wchar_t) == 2, "JUCE_NATIVE_WCHAR_IS_* macro has incorrect value"); #elif JUCE_NATIVE_WCHAR_IS_UTF32 - static_jassert (sizeof (wchar_t) == 4); + static_assert (sizeof (wchar_t) == 4, "JUCE_NATIVE_WCHAR_IS_* macro has incorrect value"); #else #error "native wchar_t size is unknown" #endif - static_jassert (sizeof (EmptyString) == sizeof (StringHolder)); + static_assert (sizeof (EmptyString) == sizeof (StringHolder), + "StringHolder is not large enough to hold an empty String"); } }; @@ -276,7 +277,6 @@ String& String::operator= (const String& other) noexcept return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS String::String (String&& other) noexcept : text (other.text) { other.text = &(emptyString.text); @@ -287,7 +287,6 @@ String& String::operator= (String&& other) noexcept std::swap (text, other.text); return *this; } -#endif inline String::PreallocationBytes::PreallocationBytes (const size_t num) noexcept : numBytes (num) {} diff --git a/modules/juce_core/text/juce_String.h b/modules/juce_core/text/juce_String.h index 0880254532..4d59bc74b8 100644 --- a/modules/juce_core/text/juce_String.h +++ b/modules/juce_core/text/juce_String.h @@ -54,9 +54,8 @@ public: /** Creates a copy of another string. */ String (const String& other) noexcept; - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ String (String&& other) noexcept; - #endif /** Creates a string from a zero-terminated ascii text string. @@ -200,9 +199,8 @@ public: /** Replaces this string's contents with another string. */ String& operator= (const String& other) noexcept; - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Moves the contents of another string to the receiver */ String& operator= (String&& other) noexcept; - #endif /** Appends another string at the end of this one. */ String& operator+= (const String& stringToAppend); diff --git a/modules/juce_core/text/juce_StringArray.cpp b/modules/juce_core/text/juce_StringArray.cpp index 5db0b9d24d..45e22b79bb 100644 --- a/modules/juce_core/text/juce_StringArray.cpp +++ b/modules/juce_core/text/juce_StringArray.cpp @@ -37,12 +37,10 @@ StringArray::StringArray (const StringArray& other) { } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS StringArray::StringArray (StringArray&& other) noexcept : strings (static_cast&&> (other.strings)) { } -#endif StringArray::StringArray (const String& firstValue) { @@ -80,13 +78,11 @@ StringArray& StringArray::operator= (const StringArray& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS StringArray& StringArray::operator= (StringArray&& other) noexcept { strings = static_cast&&> (other.strings); return *this; } -#endif #if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS StringArray::StringArray (const std::initializer_list& stringList) @@ -147,12 +143,10 @@ void StringArray::add (const String& newString) strings.add (newString); } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS void StringArray::add (String&& stringToAdd) { strings.add (static_cast (stringToAdd)); } -#endif void StringArray::insert (const int index, const String& newString) { diff --git a/modules/juce_core/text/juce_StringArray.h b/modules/juce_core/text/juce_StringArray.h index 8dd64c310c..8c5beb7667 100644 --- a/modules/juce_core/text/juce_StringArray.h +++ b/modules/juce_core/text/juce_StringArray.h @@ -48,9 +48,8 @@ public: /** Creates a copy of another string array */ StringArray (const StringArray&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ StringArray (StringArray&&) noexcept; - #endif /** Creates an array containing a single string. */ explicit StringArray (const String& firstValue); @@ -98,9 +97,8 @@ public: /** Copies the contents of another string array into this one */ StringArray& operator= (const StringArray&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move assignment operator */ StringArray& operator= (StringArray&&) noexcept; - #endif /** Swaps the contents of this and another StringArray. */ void swapWith (StringArray&) noexcept; @@ -177,10 +175,8 @@ public: /** Appends a string at the end of the array. */ void add (const String& stringToAdd); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS /** Appends a string at the end of the array. */ void add (String&& stringToAdd); - #endif /** Inserts a string into the array. diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index 7cdcb7b52f..92f30d942c 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -134,7 +134,6 @@ XmlElement& XmlElement::operator= (const XmlElement& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS XmlElement::XmlElement (XmlElement&& other) noexcept : nextListItem (static_cast&&> (other.nextListItem)), firstChildElement (static_cast&&> (other.firstChildElement)), @@ -157,7 +156,6 @@ XmlElement& XmlElement::operator= (XmlElement&& other) noexcept return *this; } -#endif void XmlElement::copyChildrenAndAttributesFrom (const XmlElement& other) { diff --git a/modules/juce_core/xml/juce_XmlElement.h b/modules/juce_core/xml/juce_XmlElement.h index 1d9da108f9..08df5ed914 100644 --- a/modules/juce_core/xml/juce_XmlElement.h +++ b/modules/juce_core/xml/juce_XmlElement.h @@ -166,10 +166,11 @@ public: /** Creates a (deep) copy of another element. */ XmlElement& operator= (const XmlElement&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS - XmlElement (XmlElement&&) noexcept; + /** Move assignment operator */ XmlElement& operator= (XmlElement&&) noexcept; - #endif + + /** Move constructor */ + XmlElement (XmlElement&&) noexcept; /** Deleting an XmlElement will also delete all of its child elements. */ ~XmlElement() noexcept; diff --git a/modules/juce_data_structures/values/juce_Value.cpp b/modules/juce_data_structures/values/juce_Value.cpp index 1034381fb6..ddfba816ad 100644 --- a/modules/juce_data_structures/values/juce_Value.cpp +++ b/modules/juce_data_structures/values/juce_Value.cpp @@ -111,7 +111,6 @@ Value::Value (const Value& other) : value (other.value) { } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Value::Value (Value&& other) noexcept { // moving a Value with listeners will lose those listeners, which @@ -132,7 +131,6 @@ Value& Value::operator= (Value&& other) noexcept value = static_cast&&> (other.value); return *this; } -#endif Value::~Value() { diff --git a/modules/juce_data_structures/values/juce_Value.h b/modules/juce_data_structures/values/juce_Value.h index da032f2674..dffbeafbb5 100644 --- a/modules/juce_data_structures/values/juce_Value.h +++ b/modules/juce_data_structures/values/juce_Value.h @@ -63,10 +63,8 @@ public: /** Creates a Value that is set to the specified value. */ explicit Value (const var& initialValue); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ Value (Value&&) noexcept; - Value& operator= (Value&&) noexcept; - #endif /** Destructor. */ ~Value(); @@ -101,6 +99,9 @@ public: */ Value& operator= (const var& newValue); + /** Move assignment operator */ + Value& operator= (Value&&) noexcept; + /** Makes this object refer to the same underlying ValueSource as another one. Once this object has been connected to another one, changing either one diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index a2f9b14c23..e4f122acd3 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -702,12 +702,10 @@ ValueTree& ValueTree::operator= (const ValueTree& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS ValueTree::ValueTree (ValueTree&& other) noexcept : object (static_cast (other.object)) { } -#endif ValueTree::~ValueTree() { diff --git a/modules/juce_data_structures/values/juce_ValueTree.h b/modules/juce_data_structures/values/juce_ValueTree.h index e48a83f3fc..c3d28e4d99 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.h +++ b/modules/juce_data_structures/values/juce_ValueTree.h @@ -92,9 +92,8 @@ public: /** Makes this object reference another node. */ ValueTree& operator= (const ValueTree&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ ValueTree (ValueTree&&) noexcept; - #endif /** Destructor. */ ~ValueTree(); diff --git a/modules/juce_graphics/colour/juce_FillType.cpp b/modules/juce_graphics/colour/juce_FillType.cpp index 6c166689e3..af9cf689bb 100644 --- a/modules/juce_graphics/colour/juce_FillType.cpp +++ b/modules/juce_graphics/colour/juce_FillType.cpp @@ -63,7 +63,6 @@ FillType& FillType::operator= (const FillType& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS FillType::FillType (FillType&& other) noexcept : colour (other.colour), gradient (other.gradient.release()), @@ -82,7 +81,6 @@ FillType& FillType::operator= (FillType&& other) noexcept transform = other.transform; return *this; } -#endif FillType::~FillType() noexcept { diff --git a/modules/juce_graphics/colour/juce_FillType.h b/modules/juce_graphics/colour/juce_FillType.h index 28effc0f4c..21be8bd921 100644 --- a/modules/juce_graphics/colour/juce_FillType.h +++ b/modules/juce_graphics/colour/juce_FillType.h @@ -64,10 +64,11 @@ public: /** Makes a copy of another FillType. */ FillType& operator= (const FillType&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ FillType (FillType&&) noexcept; + + /** Move assignment operator */ FillType& operator= (FillType&&) noexcept; - #endif /** Destructor. */ ~FillType() noexcept; diff --git a/modules/juce_graphics/fonts/juce_AttributedString.cpp b/modules/juce_graphics/fonts/juce_AttributedString.cpp index 990e5d9a41..5e339cee2b 100644 --- a/modules/juce_graphics/fonts/juce_AttributedString.cpp +++ b/modules/juce_graphics/fonts/juce_AttributedString.cpp @@ -136,7 +136,6 @@ namespace AttributedString::Attribute::Attribute() noexcept : colour (0xff000000) {} AttributedString::Attribute::~Attribute() noexcept {} -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS AttributedString::Attribute::Attribute (Attribute&& other) noexcept : range (other.range), font (static_cast (other.font)), @@ -151,7 +150,6 @@ AttributedString::Attribute& AttributedString::Attribute::operator= (Attribute&& colour = other.colour; return *this; } -#endif AttributedString::Attribute::Attribute (const Attribute& other) noexcept : range (other.range), @@ -216,7 +214,6 @@ AttributedString& AttributedString::operator= (const AttributedString& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS AttributedString::AttributedString (AttributedString&& other) noexcept : text (static_cast (other.text)), lineSpacing (other.lineSpacing), @@ -237,7 +234,6 @@ AttributedString& AttributedString::operator= (AttributedString&& other) noexcep attributes = static_cast&&> (other.attributes); return *this; } -#endif AttributedString::~AttributedString() noexcept {} diff --git a/modules/juce_graphics/fonts/juce_AttributedString.h b/modules/juce_graphics/fonts/juce_AttributedString.h index d320103040..1ab8c97638 100644 --- a/modules/juce_graphics/fonts/juce_AttributedString.h +++ b/modules/juce_graphics/fonts/juce_AttributedString.h @@ -47,10 +47,8 @@ public: AttributedString (const AttributedString&); AttributedString& operator= (const AttributedString&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS AttributedString (AttributedString&&) noexcept; AttributedString& operator= (AttributedString&&) noexcept; - #endif /** Destructor. */ ~AttributedString() noexcept; @@ -154,10 +152,8 @@ public: ~Attribute() noexcept; Attribute (const Attribute&) noexcept; Attribute& operator= (const Attribute&) noexcept; - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Attribute (Attribute&&) noexcept; Attribute& operator= (Attribute&&) noexcept; - #endif /** Creates an attribute that specifies the font and colour for a range of characters. */ Attribute (Range range, const Font& font, Colour colour) noexcept; diff --git a/modules/juce_graphics/fonts/juce_Font.cpp b/modules/juce_graphics/fonts/juce_Font.cpp index 7b7632fb8e..07fdde0cc9 100644 --- a/modules/juce_graphics/fonts/juce_Font.cpp +++ b/modules/juce_graphics/fonts/juce_Font.cpp @@ -277,7 +277,6 @@ Font& Font::operator= (const Font& other) noexcept return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Font::Font (Font&& other) noexcept : font (static_cast&&> (other.font)) { @@ -288,7 +287,6 @@ Font& Font::operator= (Font&& other) noexcept font = static_cast&&> (other.font); return *this; } -#endif Font::~Font() noexcept { diff --git a/modules/juce_graphics/fonts/juce_Font.h b/modules/juce_graphics/fonts/juce_Font.h index 3fc11bbde1..dd309cc318 100644 --- a/modules/juce_graphics/fonts/juce_Font.h +++ b/modules/juce_graphics/fonts/juce_Font.h @@ -95,10 +95,11 @@ public: */ Font(); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ Font (Font&& other) noexcept; + + /** Move assignment operator */ Font& operator= (Font&& other) noexcept; - #endif /** Copies this font from another one. */ Font& operator= (const Font& other) noexcept; diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp index c62ef39c80..f481573817 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp @@ -40,7 +40,6 @@ PositionedGlyph::PositionedGlyph (const PositionedGlyph& other) { } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept : font (static_cast (other.font)), character (other.character), glyph (other.glyph), @@ -59,7 +58,6 @@ PositionedGlyph& PositionedGlyph::operator= (PositionedGlyph&& other) noexcept whitespace = other.whitespace; return *this; } -#endif PositionedGlyph::~PositionedGlyph() {} diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.h b/modules/juce_graphics/fonts/juce_GlyphArrangement.h index 3e3def239e..09a5dcac36 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.h +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.h @@ -47,10 +47,11 @@ public: PositionedGlyph (const PositionedGlyph&); PositionedGlyph& operator= (const PositionedGlyph&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ PositionedGlyph (PositionedGlyph&&) noexcept; + + /** Move assignment operator */ PositionedGlyph& operator= (PositionedGlyph&&) noexcept; - #endif ~PositionedGlyph(); diff --git a/modules/juce_graphics/fonts/juce_TextLayout.cpp b/modules/juce_graphics/fonts/juce_TextLayout.cpp index 5d7a4524d0..658d2337d1 100644 --- a/modules/juce_graphics/fonts/juce_TextLayout.cpp +++ b/modules/juce_graphics/fonts/juce_TextLayout.cpp @@ -153,7 +153,6 @@ TextLayout::TextLayout (const TextLayout& other) lines.addCopiesOf (other.lines); } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS TextLayout::TextLayout (TextLayout&& other) noexcept : lines (static_cast&&> (other.lines)), width (other.width), height (other.height), @@ -169,7 +168,6 @@ TextLayout& TextLayout::operator= (TextLayout&& other) noexcept justification = other.justification; return *this; } -#endif TextLayout& TextLayout::operator= (const TextLayout& other) { diff --git a/modules/juce_graphics/fonts/juce_TextLayout.h b/modules/juce_graphics/fonts/juce_TextLayout.h index 08c5ca1821..a29e66dd72 100644 --- a/modules/juce_graphics/fonts/juce_TextLayout.h +++ b/modules/juce_graphics/fonts/juce_TextLayout.h @@ -45,10 +45,8 @@ public: TextLayout(); TextLayout (const TextLayout&); TextLayout& operator= (const TextLayout&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS TextLayout (TextLayout&&) noexcept; TextLayout& operator= (TextLayout&&) noexcept; - #endif /** Destructor. */ ~TextLayout(); diff --git a/modules/juce_graphics/geometry/juce_Path.cpp b/modules/juce_graphics/geometry/juce_Path.cpp index e11cff5432..d6efabee3d 100644 --- a/modules/juce_graphics/geometry/juce_Path.cpp +++ b/modules/juce_graphics/geometry/juce_Path.cpp @@ -157,7 +157,6 @@ Path& Path::operator= (const Path& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Path::Path (Path&& other) noexcept : data (static_cast&&> (other.data)), numElements (other.numElements), @@ -174,7 +173,6 @@ Path& Path::operator= (Path&& other) noexcept useNonZeroWinding = other.useNonZeroWinding; return *this; } -#endif bool Path::operator== (const Path& other) const noexcept { diff --git a/modules/juce_graphics/geometry/juce_Path.h b/modules/juce_graphics/geometry/juce_Path.h index 6ddca5dd18..046f7c314f 100644 --- a/modules/juce_graphics/geometry/juce_Path.h +++ b/modules/juce_graphics/geometry/juce_Path.h @@ -75,10 +75,11 @@ public: /** Copies this path from another one. */ Path& operator= (const Path&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ Path (Path&&) noexcept; + + /** Move assignment operator */ Path& operator= (Path&&) noexcept; - #endif bool operator== (const Path&) const noexcept; bool operator!= (const Path&) const noexcept; diff --git a/modules/juce_graphics/geometry/juce_RectangleList.h b/modules/juce_graphics/geometry/juce_RectangleList.h index ac3bc7d82f..b9328faaba 100644 --- a/modules/juce_graphics/geometry/juce_RectangleList.h +++ b/modules/juce_graphics/geometry/juce_RectangleList.h @@ -64,18 +64,18 @@ public: return *this; } - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ RectangleList (RectangleList&& other) noexcept : rects (static_cast&&> (other.rects)) { } + /** Move assignment operator */ RectangleList& operator= (RectangleList&& other) noexcept { rects = static_cast&&> (other.rects); return *this; } - #endif //============================================================================== /** Returns true if the region is empty. */ diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index 4e6f4c6340..ceab0ba17c 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -242,7 +242,6 @@ Image& Image::operator= (const Image& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS Image::Image (Image&& other) noexcept : image (static_cast (other.image)) { @@ -253,7 +252,6 @@ Image& Image::operator= (Image&& other) noexcept image = static_cast (other.image); return *this; } -#endif Image::~Image() { diff --git a/modules/juce_graphics/images/juce_Image.h b/modules/juce_graphics/images/juce_Image.h index e817cc7f4f..13cbcfa136 100644 --- a/modules/juce_graphics/images/juce_Image.h +++ b/modules/juce_graphics/images/juce_Image.h @@ -116,10 +116,11 @@ public: */ Image& operator= (const Image&); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ Image (Image&&) noexcept; + + /** Move assignment operator */ Image& operator= (Image&&) noexcept; - #endif /** Destructor. */ ~Image(); diff --git a/modules/juce_graphics/native/juce_win32_Fonts.cpp b/modules/juce_graphics/native/juce_win32_Fonts.cpp index 9d84483df5..5fa28a3218 100644 --- a/modules/juce_graphics/native/juce_win32_Fonts.cpp +++ b/modules/juce_graphics/native/juce_win32_Fonts.cpp @@ -73,7 +73,7 @@ namespace TTFNameExtractor for (int i = 0; i < numChars; ++i) buffer[i] = ByteOrder::swapIfLittleEndian (buffer[i]); - static_jassert (sizeof (CharPointer_UTF16::CharType) == sizeof (uint16)); + static_assert (sizeof (CharPointer_UTF16::CharType) == sizeof (uint16), "Sanity check UTF-16 type"); result = CharPointer_UTF16 ((CharPointer_UTF16::CharType*) buffer.getData()); } else diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index f207733f71..52bcaf1582 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -471,7 +471,7 @@ Component::Component (const String& name) noexcept Component::~Component() { - static_jassert (sizeof (flags) <= sizeof (componentFlags)); + static_assert (sizeof (flags) <= sizeof (componentFlags), "componentFlags has too many bits!"); componentListeners.call (&ComponentListener::componentBeingDeleted, *this); diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp index 4358c7be6f..878bb56628 100644 --- a/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/modules/juce_gui_basics/juce_gui_basics.cpp @@ -254,7 +254,7 @@ extern bool juce_areThereAnyAlwaysOnTopWindows(); #include "misc/juce_DropShadower.cpp" // these classes are C++11-only -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS && JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS && JUCE_COMPILER_SUPPORTS_LAMBDAS +#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS && JUCE_COMPILER_SUPPORTS_LAMBDAS #include "layout/juce_FlexBox.cpp" #endif diff --git a/modules/juce_gui_basics/juce_gui_basics.h b/modules/juce_gui_basics/juce_gui_basics.h index f299d9b78c..5913eef300 100644 --- a/modules/juce_gui_basics/juce_gui_basics.h +++ b/modules/juce_gui_basics/juce_gui_basics.h @@ -283,7 +283,7 @@ class FlexBox; #include "lookandfeel/juce_LookAndFeel_V3.h" // these classes are C++11-only -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS && JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS && JUCE_COMPILER_SUPPORTS_LAMBDAS +#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS && JUCE_COMPILER_SUPPORTS_LAMBDAS #include "layout/juce_FlexItem.h" #include "layout/juce_FlexBox.h" #endif diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index c1dbcebab9..583a11c6ba 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -1251,7 +1251,6 @@ PopupMenu& PopupMenu::operator= (const PopupMenu& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS PopupMenu::PopupMenu (PopupMenu&& other) noexcept : lookAndFeel (other.lookAndFeel) { @@ -1266,7 +1265,6 @@ PopupMenu& PopupMenu::operator= (PopupMenu&& other) noexcept lookAndFeel = other.lookAndFeel; return *this; } -#endif PopupMenu::~PopupMenu() { diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.h b/modules/juce_gui_basics/menus/juce_PopupMenu.h index edfcb088f4..4823695dd9 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.h +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.h @@ -96,10 +96,11 @@ public: /** Copies this menu from another one. */ PopupMenu& operator= (const PopupMenu& other); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ PopupMenu (PopupMenu&& other) noexcept; + + /** Move assignment operator */ PopupMenu& operator= (PopupMenu&& other) noexcept; - #endif //============================================================================== /** Resets the menu, removing all its items. */ diff --git a/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp b/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp index f1b834cc5c..86cb6c7ae0 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp +++ b/modules/juce_gui_basics/mouse/juce_MouseCursor.cpp @@ -171,7 +171,6 @@ MouseCursor& MouseCursor::operator= (const MouseCursor& other) return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS MouseCursor::MouseCursor (MouseCursor&& other) noexcept : cursorHandle (other.cursorHandle) { @@ -183,7 +182,6 @@ MouseCursor& MouseCursor::operator= (MouseCursor&& other) noexcept std::swap (cursorHandle, other.cursorHandle); return *this; } -#endif bool MouseCursor::operator== (const MouseCursor& other) const noexcept { diff --git a/modules/juce_gui_basics/mouse/juce_MouseCursor.h b/modules/juce_gui_basics/mouse/juce_MouseCursor.h index ce6983b381..831d899133 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseCursor.h +++ b/modules/juce_gui_basics/mouse/juce_MouseCursor.h @@ -111,10 +111,11 @@ public: /** Destructor. */ ~MouseCursor(); - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + /** Move constructor */ MouseCursor (MouseCursor&&) noexcept; + + /** Move assignment operator */ MouseCursor& operator= (MouseCursor&&) noexcept; - #endif /** Checks whether two mouse cursors are the same. diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp index a545acd7ac..e9bae5bdf7 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp @@ -67,7 +67,6 @@ RelativeCoordinate& RelativeCoordinate::operator= (const RelativeCoordinate& oth return *this; } -#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS RelativeCoordinate::RelativeCoordinate (RelativeCoordinate&& other) noexcept : term (static_cast (other.term)) { @@ -78,7 +77,6 @@ RelativeCoordinate& RelativeCoordinate::operator= (RelativeCoordinate&& other) n term = static_cast (other.term); return *this; } -#endif RelativeCoordinate::RelativeCoordinate (const double absoluteDistanceFromOrigin) : term (absoluteDistanceFromOrigin) diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h index 91b901da16..1524ec8ffe 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h @@ -76,11 +76,8 @@ public: RelativeCoordinate (const Expression& expression); RelativeCoordinate (const RelativeCoordinate&); RelativeCoordinate& operator= (const RelativeCoordinate&); - - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS RelativeCoordinate (RelativeCoordinate&&) noexcept; RelativeCoordinate& operator= (RelativeCoordinate&&) noexcept; - #endif /** Creates an absolute position from the parent origin on either the X or Y axis. diff --git a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp index 3da415b021..5a8c1f5b9d 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp @@ -1133,7 +1133,7 @@ struct StateHelpers ~ShaderQuadQueue() noexcept { - static_jassert (sizeof (VertexInfo) == 8); + static_assert (sizeof (VertexInfo) == 8, "Sanity check VertexInfo size"); context.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0); context.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0); context.extensions.glDeleteBuffers (2, buffers); diff --git a/modules/juce_osc/osc/juce_OSCArgument.cpp b/modules/juce_osc/osc/juce_OSCArgument.cpp index de7b6741fc..3bf8d4d9a8 100644 --- a/modules/juce_osc/osc/juce_OSCArgument.cpp +++ b/modules/juce_osc/osc/juce_OSCArgument.cpp @@ -216,17 +216,6 @@ public: assignment = copy; expect (assignment.getType() == OSCTypes::blob); expect (assignment.getBlob() == blob); - - #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS - OSCArgument move = std::move (arg); - expect (move.getType() == OSCTypes::blob); - expect (move.getBlob() == blob); - - OSCArgument moveAssignment ("this will be overwritten!"); - moveAssignment = std::move (copy); - expect (moveAssignment.getType() == OSCTypes::blob); - expect (moveAssignment.getBlob() == blob); - #endif } } } diff --git a/modules/juce_osc/osc/juce_OSCMessage.cpp b/modules/juce_osc/osc/juce_OSCMessage.cpp index 8a8cdedf0c..178d005cee 100644 --- a/modules/juce_osc/osc/juce_OSCMessage.cpp +++ b/modules/juce_osc/osc/juce_OSCMessage.cpp @@ -143,7 +143,7 @@ public: } - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES beginTest ("Initialisation with argument list (C++11 only)"); { int testInt = 42; diff --git a/modules/juce_osc/osc/juce_OSCMessage.h b/modules/juce_osc/osc/juce_OSCMessage.h index 82b72afb58..0860a3b675 100644 --- a/modules/juce_osc/osc/juce_OSCMessage.h +++ b/modules/juce_osc/osc/juce_OSCMessage.h @@ -52,7 +52,7 @@ public: OSCMessage (const OSCAddressPattern& ap) noexcept; - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES /** Constructs an OSCMessage object with the given address pattern and list of arguments. @@ -142,7 +142,7 @@ public: private: //============================================================================== - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES template void addArguments (Arg1&& arg1, Args&&... args) { @@ -160,7 +160,7 @@ private: //============================================================================== -#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS +#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES template OSCMessage::OSCMessage (const OSCAddressPattern& ap, Arg1&& arg1, Args&&... args) : addressPattern (ap) diff --git a/modules/juce_osc/osc/juce_OSCSender.h b/modules/juce_osc/osc/juce_OSCSender.h index c30045446f..046f97d026 100644 --- a/modules/juce_osc/osc/juce_OSCSender.h +++ b/modules/juce_osc/osc/juce_OSCSender.h @@ -101,7 +101,7 @@ public: bool sendToIPAddress (const String& targetIPAddress, int targetPortNumber, const OSCBundle& bundle); - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS + #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES /** Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target. @@ -138,7 +138,7 @@ private: //============================================================================== -#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS +#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES template bool OSCSender::send (const OSCAddressPattern& address, Args&&... args) { @@ -151,6 +151,6 @@ private: { return sendToIPAddress (targetIPAddress, targetPortNumber, OSCMessage (address, std::forward (args)...)); } -#endif // JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS +#endif // JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES #endif // JUCE_OSCSENDER_H_INCLUDED