diff --git a/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp b/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp index 94d19898f7..91689d332c 100644 --- a/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp @@ -189,9 +189,7 @@ MidiBuffer::Iterator::Iterator (const MidiBuffer& b) noexcept { } -MidiBuffer::Iterator::~Iterator() noexcept -{ -} +MidiBuffer::Iterator::~Iterator() noexcept{} void MidiBuffer::Iterator::setNextSamplePosition (const int samplePosition) noexcept { diff --git a/modules/juce_audio_basics/midi/juce_MidiBuffer.h b/modules/juce_audio_basics/midi/juce_MidiBuffer.h index e856bfbd2b..aa38384003 100644 --- a/modules/juce_audio_basics/midi/juce_MidiBuffer.h +++ b/modules/juce_audio_basics/midi/juce_MidiBuffer.h @@ -173,7 +173,10 @@ public: Iterator (const MidiBuffer&) noexcept; /** Creates a copy of an iterator. */ - Iterator (const Iterator&) noexcept = default; + Iterator (const Iterator&) = default; + + // VS2013 requires this, even if it's unused. + Iterator& operator= (const Iterator&) = delete; /** Destructor. */ ~Iterator() noexcept; diff --git a/modules/juce_core/maths/juce_NormalisableRange.h b/modules/juce_core/maths/juce_NormalisableRange.h index 8ce23c6d8d..7794a94282 100644 --- a/modules/juce_core/maths/juce_NormalisableRange.h +++ b/modules/juce_core/maths/juce_NormalisableRange.h @@ -38,12 +38,34 @@ class NormalisableRange { public: /** Creates a continuous range that performs a dummy mapping. */ - NormalisableRange() noexcept = default; + NormalisableRange() noexcept {} NormalisableRange (const NormalisableRange&) = default; - NormalisableRange (NormalisableRange&&) = default; NormalisableRange& operator= (const NormalisableRange&) = default; - NormalisableRange& operator= (NormalisableRange&&) = default; + + // VS2013 can't default move constructors + NormalisableRange (NormalisableRange&& other) + : start (other.start), end (other.end), + interval (other.interval), skew (other.skew), + symmetricSkew (other.symmetricSkew), + convertFrom0To1Function (static_cast (other.convertFrom0To1Function)), + convertTo0To1Function (static_cast (other.convertTo0To1Function)), + snapToLegalValueFunction (static_cast (other.snapToLegalValueFunction)) + { + } + + // VS2013 can't default move assignments + NormalisableRange& operator= (NormalisableRange&& other) + { + start = other.start; + end = other.end; + interval = other.interval; + skew = other.skew; + symmetricSkew = other.symmetricSkew; + convertFrom0To1Function = static_cast (other.convertFrom0To1Function); + convertTo0To1Function = static_cast (other.convertTo0To1Function); + snapToLegalValueFunction = static_cast (other.snapToLegalValueFunction); + } /** Creates a NormalisableRange with a given range, interval and skew factor. */ NormalisableRange (ValueType rangeStart, @@ -235,9 +257,10 @@ private: jassert (skew > ValueType()); } - std::function convertFrom0To1Function = {}, - convertTo0To1Function = {}, - snapToLegalValueFunction = {}; + typedef std::function ConverstionFunction; + ConverstionFunction convertFrom0To1Function = {}, + convertTo0To1Function = {}, + snapToLegalValueFunction = {}; }; } // namespace juce diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index d951c2be8a..a2dc715139 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -134,9 +134,7 @@ URL::DownloadTask::DownloadTask() {} URL::DownloadTask::~DownloadTask() {} //============================================================================== -URL::URL() noexcept -{ -} +URL::URL() noexcept {} URL::URL (const String& u) : url (u) { @@ -170,6 +168,28 @@ URL::URL (const String& u) : url (u) URL::URL (const String& u, int) : url (u) {} +URL::URL (URL&& other) + : url (static_cast (other.url)), + postData (static_cast (other.postData)), + parameterNames (static_cast (other.parameterNames)), + parameterValues (static_cast (other.parameterValues)), + filesToUpload (static_cast&&> (other.filesToUpload)) +{ +} + +URL& URL::operator= (URL&& other) +{ + url = static_cast (other.url); + postData = static_cast (other.postData); + parameterNames = static_cast (other.parameterNames); + parameterValues = static_cast (other.parameterValues); + filesToUpload = static_cast&&> (other.filesToUpload); + + return *this; +} + +URL::~URL() {} + URL URL::createWithoutParsing (const String& u) { return URL (u, 0); @@ -189,10 +209,6 @@ bool URL::operator!= (const URL& other) const return ! operator== (other); } -URL::~URL() -{ -} - namespace URLHelpers { static String getMangledParameters (const URL& url) diff --git a/modules/juce_core/network/juce_URL.h b/modules/juce_core/network/juce_URL.h index b3f7b4f797..83d4d40a6a 100644 --- a/modules/juce_core/network/juce_URL.h +++ b/modules/juce_core/network/juce_URL.h @@ -47,9 +47,11 @@ public: URL (const String& url); URL (const URL&) = default; - URL (URL&&) = default; URL& operator= (const URL&) = default; - URL& operator= (URL&&) = default; + + // VS2013 can't default move constructors and assignments + URL (URL&&); + URL& operator= (URL&&); /** Destructor. */ ~URL(); diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 2d40acf633..e9a2e7a8eb 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -1359,8 +1359,6 @@ struct StringCreationHelper dest.write (c); } - String&& get() noexcept { return static_cast (result); } - String result; String::CharPointerType source { nullptr }, dest { nullptr }; size_t allocatedBytes, bytesWritten = 0; @@ -1386,7 +1384,7 @@ String String::replaceCharacter (const juce_wchar charToReplace, const juce_wcha break; } - return builder.get(); + return static_cast (builder.result); } String String::replaceCharacters (StringRef charactersToReplace, StringRef charactersToInsertInstead) const @@ -1411,7 +1409,7 @@ String String::replaceCharacters (StringRef charactersToReplace, StringRef chara break; } - return builder.get(); + return static_cast (builder.result); } //============================================================================== @@ -1493,7 +1491,7 @@ String String::toUpperCase() const ++(builder.source); } - return builder.get(); + return static_cast (builder.result); } String String::toLowerCase() const @@ -1511,7 +1509,7 @@ String String::toLowerCase() const ++(builder.source); } - return builder.get(); + return static_cast (builder.result); } //============================================================================== @@ -1776,7 +1774,7 @@ String String::retainCharacters (StringRef charactersToRetain) const } builder.write (0); - return builder.get(); + return static_cast (builder.result); } String String::removeCharacters (StringRef charactersToRemove) const @@ -1797,7 +1795,7 @@ String String::removeCharacters (StringRef charactersToRemove) const break; } - return builder.get(); + return static_cast (builder.result); } String String::initialSectionContainingOnly (StringRef permittedCharacters) const @@ -2013,7 +2011,7 @@ String String::createStringFromData (const void* const unknownData, int size) } builder.write (0); - return builder.get(); + return static_cast (builder.result); } auto* start = (const char*) data; diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp index 5d2cfb3ef3..123e576be8 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.cpp @@ -39,6 +39,26 @@ PositionedGlyph::PositionedGlyph (const Font& font_, juce_wchar character_, int { } +PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept + : font (static_cast (other.font)), + character (other.character), glyph (other.glyph), + x (other.x), y (other.y), w (other.w), whitespace (other.whitespace) +{ +} + +PositionedGlyph& PositionedGlyph::operator= (PositionedGlyph&& other) noexcept +{ + font = static_cast (other.font); + character = other.character; + glyph = other.glyph; + x = other.x; + y = other.y; + w = other.w; + whitespace = other.whitespace; + + return *this; +} + PositionedGlyph::~PositionedGlyph() {} static inline void drawGlyphWithFont (Graphics& g, int glyph, const Font& font, AffineTransform t) @@ -108,10 +128,20 @@ GlyphArrangement::GlyphArrangement() glyphs.ensureStorageAllocated (128); } -GlyphArrangement::~GlyphArrangement() +GlyphArrangement::GlyphArrangement (GlyphArrangement&& other) + : glyphs (static_cast&&> (other.glyphs)) +{ +} + +GlyphArrangement& GlyphArrangement::operator= (GlyphArrangement&& other) { + glyphs = static_cast&&> (other.glyphs); + + return *this; } +GlyphArrangement::~GlyphArrangement() {} + //============================================================================== void GlyphArrangement::clear() { diff --git a/modules/juce_graphics/fonts/juce_GlyphArrangement.h b/modules/juce_graphics/fonts/juce_GlyphArrangement.h index 0a8a169db4..af55c13975 100644 --- a/modules/juce_graphics/fonts/juce_GlyphArrangement.h +++ b/modules/juce_graphics/fonts/juce_GlyphArrangement.h @@ -42,15 +42,18 @@ class JUCE_API PositionedGlyph final public: //============================================================================== PositionedGlyph() noexcept; - ~PositionedGlyph(); PositionedGlyph (const Font& font, juce_wchar character, int glyphNumber, float anchorX, float baselineY, float width, bool isWhitespace); PositionedGlyph (const PositionedGlyph&) = default; - PositionedGlyph (PositionedGlyph&&) noexcept = default; PositionedGlyph& operator= (const PositionedGlyph&) = default; - PositionedGlyph& operator= (PositionedGlyph&&) noexcept = default; + + // VS2013 can't default move constructors and assignmants + PositionedGlyph (PositionedGlyph&&) noexcept; + PositionedGlyph& operator= (PositionedGlyph&&) noexcept; + + ~PositionedGlyph(); /** Returns the character the glyph represents. */ juce_wchar getCharacter() const noexcept { return character; } @@ -124,9 +127,11 @@ public: GlyphArrangement(); GlyphArrangement (const GlyphArrangement&) = default; - GlyphArrangement (GlyphArrangement&&) = default; GlyphArrangement& operator= (const GlyphArrangement&) = default; - GlyphArrangement& operator= (GlyphArrangement&&) = default; + + // VS2013 can't default move constructors and assignmants + GlyphArrangement (GlyphArrangement&&); + GlyphArrangement& operator= (GlyphArrangement&&); /** Destructor. */ ~GlyphArrangement(); diff --git a/modules/juce_gui_basics/native/juce_MultiTouchMapper.h b/modules/juce_gui_basics/native/juce_MultiTouchMapper.h index 2fa1e0056a..f72711bf54 100644 --- a/modules/juce_gui_basics/native/juce_MultiTouchMapper.h +++ b/modules/juce_gui_basics/native/juce_MultiTouchMapper.h @@ -82,12 +82,22 @@ private: struct TouchInfo { TouchInfo() noexcept : touchId (0), owner (nullptr) {} - TouchInfo (IDType idToUse, ComponentPeer* peer) noexcept : touchId (idToUse), owner (peer) {} - TouchInfo (const TouchInfo&) noexcept = default; - TouchInfo (TouchInfo&&) noexcept = default; + TouchInfo (IDType idToUse, ComponentPeer* peer) noexcept : touchId (idToUse), owner (peer) {} - TouchInfo& operator= (const TouchInfo&) noexcept = default; - TouchInfo& operator= (TouchInfo&&) noexcept = default; + TouchInfo (const TouchInfo&) = default; + TouchInfo& operator= (const TouchInfo&) = default; + + // VS2013 can't default move constructors + TouchInfo (TouchInfo&& other) noexcept : touchId (other.touchId), owner (other.owner) {} + + // VS2013 can't default move assignments + TouchInfo& operator= (TouchInfo&& other) noexcept + { + touchId = other.touchId; + owner = other.owner; + + return *this; + } IDType touchId; ComponentPeer* owner; diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp index e3d436b756..cc26f77ed0 100644 --- a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp @@ -74,7 +74,15 @@ public: } UniformTextSection (const UniformTextSection&) = default; - UniformTextSection (UniformTextSection&&) = default; + + // VS2013 can't default move constructors + UniformTextSection (UniformTextSection&& other) + : font (static_cast (other.font)), + colour (other.colour), + atoms (static_cast&&> (other.atoms)) + { + } + UniformTextSection& operator= (const UniformTextSection&) = delete; void append (UniformTextSection& other, const juce_wchar passwordChar) diff --git a/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp b/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp index 34abe08472..2c3cd4355c 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CodeDocument.cpp @@ -126,13 +126,9 @@ public: }; //============================================================================== -CodeDocument::Iterator::Iterator (const CodeDocument& doc) noexcept : document (&doc) -{ -} +CodeDocument::Iterator::Iterator (const CodeDocument& doc) noexcept : document (&doc) {} -CodeDocument::Iterator::~Iterator() noexcept -{ -} +CodeDocument::Iterator::~Iterator() noexcept {} juce_wchar CodeDocument::Iterator::nextChar() noexcept { diff --git a/modules/juce_gui_extra/code_editor/juce_CodeDocument.h b/modules/juce_gui_extra/code_editor/juce_CodeDocument.h index 04b3c94c17..5941938841 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeDocument.h +++ b/modules/juce_gui_extra/code_editor/juce_CodeDocument.h @@ -357,8 +357,8 @@ public: { public: Iterator (const CodeDocument& document) noexcept; - Iterator (const Iterator&) noexcept = default; - Iterator& operator= (const Iterator&) noexcept = default; + Iterator (const Iterator&) = default; + Iterator& operator= (const Iterator&) = default; ~Iterator() noexcept; /** Reads the next character and returns it.