Browse Source

Added a compiler error if your compiler is too old and removed numerous code checks for old compilers which are now deprecated

tags/2021-05-28
hogliux 8 years ago
parent
commit
9f3fb1c0a6
80 changed files with 121 additions and 263 deletions
  1. +0
    -2
      doxygen/Doxyfile
  2. +1
    -1
      examples/Demo/Source/Demos/FlexBoxDemo.cpp
  3. +0
    -2
      extras/BLOCKS/doxygen/Doxyfile
  4. +9
    -5
      modules/juce_audio_basics/buffers/juce_AudioDataConverters.h
  5. +0
    -2
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
  6. +0
    -2
      modules/juce_audio_basics/midi/juce_MidiMessage.cpp
  7. +3
    -2
      modules/juce_audio_basics/midi/juce_MidiMessage.h
  8. +2
    -2
      modules/juce_audio_basics/midi/juce_MidiMessageSequence.h
  9. +0
    -6
      modules/juce_core/containers/juce_Array.h
  10. +0
    -2
      modules/juce_core/containers/juce_ArrayAllocationBase.h
  11. +0
    -2
      modules/juce_core/containers/juce_LinkedListPointer.h
  12. +0
    -4
      modules/juce_core/containers/juce_NamedValueSet.cpp
  13. +3
    -6
      modules/juce_core/containers/juce_NamedValueSet.h
  14. +2
    -2
      modules/juce_core/containers/juce_OwnedArray.h
  15. +0
    -4
      modules/juce_core/containers/juce_Variant.cpp
  16. +0
    -2
      modules/juce_core/containers/juce_Variant.h
  17. +0
    -2
      modules/juce_core/files/juce_File.cpp
  18. +3
    -2
      modules/juce_core/files/juce_File.h
  19. +0
    -2
      modules/juce_core/maths/juce_BigInteger.cpp
  20. +3
    -2
      modules/juce_core/maths/juce_BigInteger.h
  21. +0
    -2
      modules/juce_core/maths/juce_Expression.cpp
  22. +3
    -2
      modules/juce_core/maths/juce_Expression.h
  23. +2
    -2
      modules/juce_core/memory/juce_Atomic.h
  24. +2
    -2
      modules/juce_core/memory/juce_HeapBlock.h
  25. +0
    -3
      modules/juce_core/memory/juce_MemoryBlock.cpp
  26. +3
    -2
      modules/juce_core/memory/juce_MemoryBlock.h
  27. +0
    -4
      modules/juce_core/memory/juce_ReferenceCountedObject.h
  28. +4
    -5
      modules/juce_core/memory/juce_ScopedPointer.h
  29. +4
    -3
      modules/juce_core/memory/juce_WeakReference.h
  30. +0
    -2
      modules/juce_core/misc/juce_Result.cpp
  31. +0
    -3
      modules/juce_core/misc/juce_Result.h
  32. +2
    -1
      modules/juce_core/native/juce_win32_Files.cpp
  33. +2
    -1
      modules/juce_core/native/juce_win32_Threads.cpp
  34. +1
    -2
      modules/juce_core/streams/juce_InputStream.cpp
  35. +0
    -26
      modules/juce_core/system/juce_CompilerSupport.h
  36. +0
    -24
      modules/juce_core/system/juce_PlatformDefs.h
  37. +9
    -9
      modules/juce_core/system/juce_SystemStats.cpp
  38. +10
    -6
      modules/juce_core/system/juce_TargetPlatform.h
  39. +0
    -2
      modules/juce_core/text/juce_Identifier.cpp
  40. +0
    -2
      modules/juce_core/text/juce_Identifier.h
  41. +5
    -6
      modules/juce_core/text/juce_String.cpp
  42. +2
    -4
      modules/juce_core/text/juce_String.h
  43. +0
    -6
      modules/juce_core/text/juce_StringArray.cpp
  44. +2
    -6
      modules/juce_core/text/juce_StringArray.h
  45. +0
    -2
      modules/juce_core/xml/juce_XmlElement.cpp
  46. +4
    -3
      modules/juce_core/xml/juce_XmlElement.h
  47. +0
    -2
      modules/juce_data_structures/values/juce_Value.cpp
  48. +4
    -3
      modules/juce_data_structures/values/juce_Value.h
  49. +0
    -2
      modules/juce_data_structures/values/juce_ValueTree.cpp
  50. +1
    -2
      modules/juce_data_structures/values/juce_ValueTree.h
  51. +0
    -2
      modules/juce_graphics/colour/juce_FillType.cpp
  52. +3
    -2
      modules/juce_graphics/colour/juce_FillType.h
  53. +0
    -4
      modules/juce_graphics/fonts/juce_AttributedString.cpp
  54. +0
    -4
      modules/juce_graphics/fonts/juce_AttributedString.h
  55. +0
    -2
      modules/juce_graphics/fonts/juce_Font.cpp
  56. +3
    -2
      modules/juce_graphics/fonts/juce_Font.h
  57. +0
    -2
      modules/juce_graphics/fonts/juce_GlyphArrangement.cpp
  58. +3
    -2
      modules/juce_graphics/fonts/juce_GlyphArrangement.h
  59. +0
    -2
      modules/juce_graphics/fonts/juce_TextLayout.cpp
  60. +0
    -2
      modules/juce_graphics/fonts/juce_TextLayout.h
  61. +0
    -2
      modules/juce_graphics/geometry/juce_Path.cpp
  62. +3
    -2
      modules/juce_graphics/geometry/juce_Path.h
  63. +2
    -2
      modules/juce_graphics/geometry/juce_RectangleList.h
  64. +0
    -2
      modules/juce_graphics/images/juce_Image.cpp
  65. +3
    -2
      modules/juce_graphics/images/juce_Image.h
  66. +1
    -1
      modules/juce_graphics/native/juce_win32_Fonts.cpp
  67. +1
    -1
      modules/juce_gui_basics/components/juce_Component.cpp
  68. +1
    -1
      modules/juce_gui_basics/juce_gui_basics.cpp
  69. +1
    -1
      modules/juce_gui_basics/juce_gui_basics.h
  70. +0
    -2
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp
  71. +3
    -2
      modules/juce_gui_basics/menus/juce_PopupMenu.h
  72. +0
    -2
      modules/juce_gui_basics/mouse/juce_MouseCursor.cpp
  73. +3
    -2
      modules/juce_gui_basics/mouse/juce_MouseCursor.h
  74. +0
    -2
      modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp
  75. +0
    -3
      modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h
  76. +1
    -1
      modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp
  77. +0
    -11
      modules/juce_osc/osc/juce_OSCArgument.cpp
  78. +1
    -1
      modules/juce_osc/osc/juce_OSCMessage.cpp
  79. +3
    -3
      modules/juce_osc/osc/juce_OSCMessage.h
  80. +3
    -3
      modules/juce_osc/osc/juce_OSCSender.h

+ 0
- 2
doxygen/Doxyfile View File

@@ -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 \


+ 1
- 1
examples/Demo/Source/Demos/FlexBoxDemo.cpp View File

@@ -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,


+ 0
- 2
extras/BLOCKS/doxygen/Doxyfile View File

@@ -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 \


+ 9
- 5
modules/juce_audio_basics/buffers/juce_AudioDataConverters.h View File

@@ -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 <class OtherPointerType>
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);


+ 0
- 2
modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h View File

@@ -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.


+ 0
- 2
modules/juce_audio_basics/midi/juce_MidiMessage.cpp View File

@@ -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
{


+ 3
- 2
modules/juce_audio_basics/midi/juce_MidiMessage.h View File

@@ -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.


+ 2
- 2
modules/juce_audio_basics/midi/juce_MidiMessageSequence.h View File

@@ -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<OwnedArray<MidiEventHolder>&&> (other.list))
{}
/** Move assignment operator */
MidiMessageSequence& operator= (MidiMessageSequence&& other) noexcept
{
list = static_cast<OwnedArray<MidiEventHolder>&&> (other.list);
return *this;
}
#endif
/** Destructor. */
~MidiMessageSequence();


+ 0
- 6
modules/juce_core/containers/juce_Array.h View File

@@ -84,14 +84,12 @@ public:
new (data.elements + i) ElementType (other.data.elements[i]);
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
Array (Array<ElementType, TypeOfCriticalSectionToUse>&& other) noexcept
: data (static_cast<ArrayAllocationBase<ElementType, TypeOfCriticalSectionToUse>&&> (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<ElementType&&> (newElement));
}
#endif
/** Inserts a new element into the array at a given position.


+ 0
- 2
modules/juce_core/containers/juce_ArrayAllocationBase.h View File

@@ -60,7 +60,6 @@ public:
{
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
ArrayAllocationBase (ArrayAllocationBase<ElementType, TypeOfCriticalSectionToUse>&& other) noexcept
: elements (static_cast<HeapBlock<ElementType>&&> (other.elements)),
numAllocated (other.numAllocated)
@@ -73,7 +72,6 @@ public:
numAllocated = other.numAllocated;
return *this;
}
#endif
//==============================================================================
/** Changes the amount of storage allocated.


+ 0
- 2
modules/juce_core/containers/juce_LinkedListPointer.h View File

@@ -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. */


+ 0
- 4
modules/juce_core/containers/juce_NamedValueSet.cpp View File

@@ -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<Array<NamedValue>&&> (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<var&&> (newValue)));
return true;
}
#endif
bool NamedValueSet::set (const Identifier& name, const var& newValue)
{


+ 3
- 6
modules/juce_core/containers/juce_NamedValueSet.h View File

@@ -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<Identifier&&> (other.name)),
value (static_cast<var&&> (other.value))
@@ -87,7 +87,6 @@ public:
value = static_cast<var&&> (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;


+ 2
- 2
modules/juce_core/containers/juce_OwnedArray.h View File

@@ -74,7 +74,7 @@ public:
deleteAllObjects();
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
/** Move constructor */
OwnedArray (OwnedArray&& other) noexcept
: data (static_cast<ArrayAllocationBase <ObjectClass*, TypeOfCriticalSectionToUse>&&> (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. */


+ 0
- 4
modules/juce_core/containers/juce_Variant.cpp View File

@@ -358,9 +358,7 @@ public:
struct RefCountedArray : public ReferenceCountedObject
{
RefCountedArray (const Array<var>& a) : array (a) { incReferenceCount(); }
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
RefCountedArray (Array<var>&& a) : array (static_cast<Array<var>&&> (a)) { incReferenceCount(); }
#endif
Array<var> array;
};
};
@@ -527,7 +525,6 @@ var& var::operator= (const Array<var>& 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<String&&> (v));
return *this;
}
#endif
//==============================================================================
bool var::equals (const var& other) const noexcept


+ 0
- 2
modules/juce_core/containers/juce_Variant.h View File

@@ -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>&&);
var& operator= (var&&) noexcept;
var& operator= (String&&);
#endif
void swapWith (var& other) noexcept;


+ 0
- 2
modules/juce_core/files/juce_File.cpp View File

@@ -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<String&&> (other.fullPath))
{
@@ -68,7 +67,6 @@ File& File::operator= (File&& other) noexcept
fullPath = static_cast<String&&> (other.fullPath);
return *this;
}
#endif
#if JUCE_ALLOW_STATIC_NULL_VARIABLES
const File File::nonexistent;


+ 3
- 2
modules/juce_core/files/juce_File.h View File

@@ -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


+ 0
- 2
modules/juce_core/maths/juce_BigInteger.cpp View File

@@ -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<HeapBlock<uint32>&&> (other.heapAllocation)),
allocatedSize (other.allocatedSize),
@@ -138,7 +137,6 @@ BigInteger& BigInteger::operator= (BigInteger&& other) noexcept
negative = other.negative;
return *this;
}
#endif
BigInteger::~BigInteger()
{


+ 3
- 2
modules/juce_core/maths/juce_BigInteger.h View File

@@ -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();


+ 0
- 2
modules/juce_core/maths/juce_Expression.cpp View File

@@ -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<ReferenceCountedObjectPtr<Term>&&> (other.term))
{
@@ -969,7 +968,6 @@ Expression& Expression::operator= (Expression&& other) noexcept
term = static_cast<ReferenceCountedObjectPtr<Term>&&> (other.term);
return *this;
}
#endif
Expression::Expression (const String& stringToParse, String& parseError)
{


+ 3
- 2
modules/juce_core/maths/juce_Expression.h View File

@@ -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);


+ 2
- 2
modules/juce_core/memory/juce_Atomic.h View File

@@ -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. */


+ 2
- 2
modules/juce_core/memory/juce_HeapBlock.h View File

@@ -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.


+ 0
- 3
modules/juce_core/memory/juce_MemoryBlock.cpp View File

@@ -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<HeapBlock<char>&&> (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


+ 3
- 2
modules/juce_core/memory/juce_MemoryBlock.h View File

@@ -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.


+ 0
- 4
modules/juce_core/memory/juce_ReferenceCountedObject.h View File

@@ -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


+ 4
- 5
modules/juce_core/memory/juce_ScopedPointer.h View File

@@ -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<ObjectType>::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<ObjectType>& pointer1, ObjectType* const po
#ifndef DOXYGEN
// NB: This is just here to prevent any silly attempts to call deleteAndZero() on a ScopedPointer.
template <typename Type>
void deleteAndZero (ScopedPointer<Type>&) { static_jassert (sizeof (Type) == 12345); }
void deleteAndZero (ScopedPointer<Type>&) { static_assert (sizeof (Type) == 12345,
"Attempt to call deleteAndZero() on a ScopedPointer"); }
#endif
#endif // JUCE_SCOPEDPOINTER_H_INCLUDED

+ 4
- 3
modules/juce_core/memory/juce_WeakReference.h View File

@@ -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<SharedRef&&> (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<SharedRef&&> (other.holder)) {}
/** Move assignment operator */
WeakReference& operator= (WeakReference&& other) noexcept { holder = static_cast<SharedRef&&> (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; }


+ 0
- 2
modules/juce_core/misc/juce_Result.cpp View File

@@ -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<String&&> (other.errorMessage))
{
@@ -57,7 +56,6 @@ Result& Result::operator= (Result&& other) noexcept
errorMessage = static_cast<String&&> (other.errorMessage);
return *this;
}
#endif
bool Result::operator== (const Result& other) const noexcept
{


+ 0
- 3
modules/juce_core/misc/juce_Result.h View File

@@ -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;


+ 2
- 1
modules/juce_core/native/juce_win32_Files.cpp View File

@@ -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<const ULARGE_INTEGER*> (ft)->QuadPart - 116444736000000000LL) / 10000);
}


+ 2
- 1
modules/juce_core/native/juce_win32_Threads.cpp View File

@@ -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);
}


+ 1
- 2
modules/juce_core/streams/juce_InputStream.cpp View File

@@ -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;


+ 0
- 26
modules/juce_core/system/juce_CompilerSupport.h View File

@@ -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


+ 0
- 24
modules/juce_core/system/juce_PlatformDefs.h View File

@@ -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 <bool b> struct JuceStaticAssert;
template <> struct JuceStaticAssert<true> { 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<expression>::dummy();
#endif
/** This is a shorthand macro for declaring stubs for a class's copy constructor and operator=.
For example, instead of


+ 9
- 9
modules/juce_core/system/juce_SystemStats.cpp View File

@@ -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)


+ 10
- 6
modules/juce_core/system/juce_TargetPlatform.h View File

@@ -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


+ 0
- 2
modules/juce_core/text/juce_Identifier.cpp View File

@@ -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<String&&> (other.name)) {}
Identifier& Identifier::operator= (Identifier&& other) noexcept
@@ -41,7 +40,6 @@ Identifier& Identifier::operator= (Identifier&& other) noexcept
name = static_cast<String&&> (other.name);
return *this;
}
#endif
Identifier& Identifier::operator= (const Identifier& other) noexcept
{


+ 0
- 2
modules/juce_core/text/juce_Identifier.h View File

@@ -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;


+ 5
- 6
modules/juce_core/text/juce_String.cpp View File

@@ -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) {}


+ 2
- 4
modules/juce_core/text/juce_String.h View File

@@ -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);


+ 0
- 6
modules/juce_core/text/juce_StringArray.cpp View File

@@ -37,12 +37,10 @@ StringArray::StringArray (const StringArray& other)
{
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
StringArray::StringArray (StringArray&& other) noexcept
: strings (static_cast<Array <String>&&> (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<Array<String>&&> (other.strings);
return *this;
}
#endif
#if JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS
StringArray::StringArray (const std::initializer_list<const char*>& 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<String&&> (stringToAdd));
}
#endif
void StringArray::insert (const int index, const String& newString)
{


+ 2
- 6
modules/juce_core/text/juce_StringArray.h View File

@@ -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.


+ 0
- 2
modules/juce_core/xml/juce_XmlElement.cpp View File

@@ -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<LinkedListPointer<XmlElement>&&> (other.nextListItem)),
firstChildElement (static_cast<LinkedListPointer<XmlElement>&&> (other.firstChildElement)),
@@ -157,7 +156,6 @@ XmlElement& XmlElement::operator= (XmlElement&& other) noexcept
return *this;
}
#endif
void XmlElement::copyChildrenAndAttributesFrom (const XmlElement& other)
{


+ 4
- 3
modules/juce_core/xml/juce_XmlElement.h View File

@@ -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;


+ 0
- 2
modules/juce_data_structures/values/juce_Value.cpp View File

@@ -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<ReferenceCountedObjectPtr<ValueSource>&&> (other.value);
return *this;
}
#endif
Value::~Value()
{


+ 4
- 3
modules/juce_data_structures/values/juce_Value.h View File

@@ -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


+ 0
- 2
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -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<SharedObject::Ptr&&> (other.object))
{
}
#endif
ValueTree::~ValueTree()
{


+ 1
- 2
modules/juce_data_structures/values/juce_ValueTree.h View File

@@ -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();


+ 0
- 2
modules/juce_graphics/colour/juce_FillType.cpp View File

@@ -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
{


+ 3
- 2
modules/juce_graphics/colour/juce_FillType.h View File

@@ -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;


+ 0
- 4
modules/juce_graphics/fonts/juce_AttributedString.cpp View File

@@ -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<Font&&> (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<String&&> (other.text)),
lineSpacing (other.lineSpacing),
@@ -237,7 +234,6 @@ AttributedString& AttributedString::operator= (AttributedString&& other) noexcep
attributes = static_cast<Array<Attribute>&&> (other.attributes);
return *this;
}
#endif
AttributedString::~AttributedString() noexcept {}


+ 0
- 4
modules/juce_graphics/fonts/juce_AttributedString.h View File

@@ -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<int> range, const Font& font, Colour colour) noexcept;


+ 0
- 2
modules/juce_graphics/fonts/juce_Font.cpp View File

@@ -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<ReferenceCountedObjectPtr<SharedFontInternal>&&> (other.font))
{
@@ -288,7 +287,6 @@ Font& Font::operator= (Font&& other) noexcept
font = static_cast<ReferenceCountedObjectPtr<SharedFontInternal>&&> (other.font);
return *this;
}
#endif
Font::~Font() noexcept
{


+ 3
- 2
modules/juce_graphics/fonts/juce_Font.h View File

@@ -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;


+ 0
- 2
modules/juce_graphics/fonts/juce_GlyphArrangement.cpp View File

@@ -40,7 +40,6 @@ PositionedGlyph::PositionedGlyph (const PositionedGlyph& other)
{
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept
: font (static_cast<Font&&> (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() {}


+ 3
- 2
modules/juce_graphics/fonts/juce_GlyphArrangement.h View File

@@ -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();


+ 0
- 2
modules/juce_graphics/fonts/juce_TextLayout.cpp View File

@@ -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<OwnedArray<Line>&&> (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)
{


+ 0
- 2
modules/juce_graphics/fonts/juce_TextLayout.h View File

@@ -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();


+ 0
- 2
modules/juce_graphics/geometry/juce_Path.cpp View File

@@ -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<ArrayAllocationBase <float, DummyCriticalSection>&&> (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
{


+ 3
- 2
modules/juce_graphics/geometry/juce_Path.h View File

@@ -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;


+ 2
- 2
modules/juce_graphics/geometry/juce_RectangleList.h View File

@@ -64,18 +64,18 @@ public:
return *this;
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
/** Move constructor */
RectangleList (RectangleList&& other) noexcept
: rects (static_cast<Array<RectangleType>&&> (other.rects))
{
}
/** Move assignment operator */
RectangleList& operator= (RectangleList&& other) noexcept
{
rects = static_cast<Array<RectangleType>&&> (other.rects);
return *this;
}
#endif
//==============================================================================
/** Returns true if the region is empty. */


+ 0
- 2
modules/juce_graphics/images/juce_Image.cpp View File

@@ -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<ImagePixelData::Ptr&&> (other.image))
{
@@ -253,7 +252,6 @@ Image& Image::operator= (Image&& other) noexcept
image = static_cast<ImagePixelData::Ptr&&> (other.image);
return *this;
}
#endif
Image::~Image()
{


+ 3
- 2
modules/juce_graphics/images/juce_Image.h View File

@@ -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();


+ 1
- 1
modules/juce_graphics/native/juce_win32_Fonts.cpp View File

@@ -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


+ 1
- 1
modules/juce_gui_basics/components/juce_Component.cpp View File

@@ -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);


+ 1
- 1
modules/juce_gui_basics/juce_gui_basics.cpp View File

@@ -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


+ 1
- 1
modules/juce_gui_basics/juce_gui_basics.h View File

@@ -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


+ 0
- 2
modules/juce_gui_basics/menus/juce_PopupMenu.cpp View File

@@ -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()
{


+ 3
- 2
modules/juce_gui_basics/menus/juce_PopupMenu.h View File

@@ -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. */


+ 0
- 2
modules/juce_gui_basics/mouse/juce_MouseCursor.cpp View File

@@ -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
{


+ 3
- 2
modules/juce_gui_basics/mouse/juce_MouseCursor.h View File

@@ -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.


+ 0
- 2
modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp View File

@@ -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<Expression&&> (other.term))
{
@@ -78,7 +77,6 @@ RelativeCoordinate& RelativeCoordinate::operator= (RelativeCoordinate&& other) n
term = static_cast<Expression&&> (other.term);
return *this;
}
#endif
RelativeCoordinate::RelativeCoordinate (const double absoluteDistanceFromOrigin)
: term (absoluteDistanceFromOrigin)


+ 0
- 3
modules/juce_gui_basics/positioning/juce_RelativeCoordinate.h View File

@@ -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.


+ 1
- 1
modules/juce_opengl/opengl/juce_OpenGLGraphicsContext.cpp View File

@@ -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);


+ 0
- 11
modules/juce_osc/osc/juce_OSCArgument.cpp View File

@@ -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
}
}
}


+ 1
- 1
modules/juce_osc/osc/juce_OSCMessage.cpp View File

@@ -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;


+ 3
- 3
modules/juce_osc/osc/juce_OSCMessage.h View File

@@ -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 <typename Arg1, typename... Args>
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 <typename Arg1, typename... Args>
OSCMessage::OSCMessage (const OSCAddressPattern& ap, Arg1&& arg1, Args&&... args)
: addressPattern (ap)


+ 3
- 3
modules/juce_osc/osc/juce_OSCSender.h View File

@@ -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 <typename... Args>
bool OSCSender::send (const OSCAddressPattern& address, Args&&... args)
{
@@ -151,6 +151,6 @@ private:
{
return sendToIPAddress (targetIPAddress, targetPortNumber, OSCMessage (address, std::forward<Args> (args)...));
}
#endif // JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
#endif // JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES
#endif // JUCE_OSCSENDER_H_INCLUDED

Loading…
Cancel
Save