Browse Source

Replaced all uses of static_cast<Type&&> with std::move

tags/2021-05-28
ed 7 years ago
parent
commit
eaf0f990d4
59 changed files with 159 additions and 159 deletions
  1. +2
    -2
      examples/Audio/AudioPlaybackDemo.h
  2. +2
    -2
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h
  3. +2
    -2
      modules/juce_audio_basics/midi/juce_MidiFile.cpp
  4. +4
    -4
      modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp
  5. +6
    -6
      modules/juce_audio_devices/native/juce_android_OpenSL.cpp
  6. +2
    -2
      modules/juce_audio_processors/format_types/juce_VSTCommon.h
  7. +2
    -2
      modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp
  8. +2
    -2
      modules/juce_core/containers/juce_ArrayAllocationBase.h
  9. +11
    -11
      modules/juce_core/containers/juce_NamedValueSet.cpp
  10. +2
    -2
      modules/juce_core/containers/juce_SortedSet.h
  11. +2
    -2
      modules/juce_core/containers/juce_SparseSet.h
  12. +5
    -5
      modules/juce_core/containers/juce_Variant.cpp
  13. +2
    -2
      modules/juce_core/files/juce_File.cpp
  14. +2
    -2
      modules/juce_core/javascript/juce_Javascript.cpp
  15. +2
    -2
      modules/juce_core/maths/juce_BigInteger.cpp
  16. +3
    -3
      modules/juce_core/maths/juce_Expression.cpp
  17. +6
    -6
      modules/juce_core/maths/juce_NormalisableRange.h
  18. +2
    -2
      modules/juce_core/memory/juce_MemoryBlock.cpp
  19. +2
    -2
      modules/juce_core/memory/juce_WeakReference.h
  20. +2
    -2
      modules/juce_core/misc/juce_Result.cpp
  21. +6
    -6
      modules/juce_core/misc/juce_StdFunctionCompat.cpp
  22. +1
    -1
      modules/juce_core/native/juce_android_Files.cpp
  23. +12
    -12
      modules/juce_core/network/juce_URL.cpp
  24. +1
    -1
      modules/juce_core/streams/juce_URLInputSource.cpp
  25. +2
    -2
      modules/juce_core/text/juce_Identifier.cpp
  26. +7
    -7
      modules/juce_core/text/juce_String.cpp
  27. +3
    -3
      modules/juce_core/text/juce_StringArray.cpp
  28. +8
    -8
      modules/juce_core/xml/juce_XmlElement.cpp
  29. +2
    -2
      modules/juce_data_structures/values/juce_Value.cpp
  30. +5
    -5
      modules/juce_data_structures/values/juce_ValueTree.cpp
  31. +1
    -1
      modules/juce_dsp/frequency/juce_FFT.cpp
  32. +1
    -1
      modules/juce_dsp/processors/juce_FIRFilter.h
  33. +1
    -1
      modules/juce_dsp/processors/juce_IIRFilter_Impl.h
  34. +1
    -1
      modules/juce_dsp/processors/juce_ProcessorDuplicator.h
  35. +1
    -1
      modules/juce_dsp/processors/juce_StateVariableFilter.h
  36. +1
    -1
      modules/juce_events/native/juce_android_Messaging.cpp
  37. +2
    -2
      modules/juce_graphics/colour/juce_ColourGradient.cpp
  38. +5
    -5
      modules/juce_graphics/colour/juce_FillType.cpp
  39. +1
    -1
      modules/juce_graphics/contexts/juce_GraphicsContext.cpp
  40. +2
    -2
      modules/juce_graphics/fonts/juce_Font.cpp
  41. +4
    -4
      modules/juce_graphics/fonts/juce_GlyphArrangement.cpp
  42. +2
    -2
      modules/juce_graphics/fonts/juce_TextLayout.cpp
  43. +2
    -2
      modules/juce_graphics/geometry/juce_Path.cpp
  44. +2
    -2
      modules/juce_graphics/geometry/juce_RectangleList.h
  45. +2
    -2
      modules/juce_graphics/images/juce_Image.cpp
  46. +1
    -1
      modules/juce_gui_basics/drawables/juce_DrawablePath.cpp
  47. +1
    -1
      modules/juce_gui_basics/filebrowser/juce_ContentSharer.cpp
  48. +1
    -1
      modules/juce_gui_basics/filebrowser/juce_FileChooser.cpp
  49. +1
    -1
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp
  50. +2
    -2
      modules/juce_gui_basics/positioning/juce_RelativeCoordinate.cpp
  51. +2
    -2
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  52. +4
    -4
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp
  53. +1
    -1
      modules/juce_osc/osc/juce_OSCArgument.cpp
  54. +1
    -1
      modules/juce_osc/osc/juce_OSCMessage.cpp
  55. +1
    -1
      modules/juce_video/capture/juce_CameraDevice.cpp
  56. +2
    -2
      modules/juce_video/native/juce_android_CameraDevice.h
  57. +2
    -2
      modules/juce_video/native/juce_ios_CameraDevice.h
  58. +1
    -1
      modules/juce_video/native/juce_mac_CameraDevice.h
  59. +1
    -1
      modules/juce_video/native/juce_win32_CameraDevice.h

+ 2
- 2
examples/Audio/AudioPlaybackDemo.h View File

@@ -423,7 +423,7 @@ private:
void showAudioResource (URL resource) void showAudioResource (URL resource)
{ {
if (loadURLIntoTransport (resource)) if (loadURLIntoTransport (resource))
currentAudioFile = static_cast<URL&&> (resource);
currentAudioFile = std::move (resource);
zoomSlider.setValue (0, dontSendNotification); zoomSlider.setValue (0, dontSendNotification);
thumbnail->setURL (currentAudioFile); thumbnail->setURL (currentAudioFile);
@@ -513,7 +513,7 @@ private:
{ {
auto u = fc.getURLResult(); auto u = fc.getURLResult();
safeThis->showAudioResource (static_cast<URL&&> (u));
safeThis->showAudioResource (std::move (u));
} }
safeThis->fileChooser = nullptr; safeThis->fileChooser = nullptr;


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

@@ -179,7 +179,7 @@ public:
: numChannels (other.numChannels), : numChannels (other.numChannels),
size (other.size), size (other.size),
allocatedBytes (other.allocatedBytes), allocatedBytes (other.allocatedBytes),
allocatedData (static_cast<HeapBlock<char, true>&&> (other.allocatedData)),
allocatedData (std::move (other.allocatedData)),
isClear (other.isClear) isClear (other.isClear)
{ {
if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) if (numChannels < (int) numElementsInArray (preallocatedChannelSpace))
@@ -205,7 +205,7 @@ public:
numChannels = other.numChannels; numChannels = other.numChannels;
size = other.size; size = other.size;
allocatedBytes = other.allocatedBytes; allocatedBytes = other.allocatedBytes;
allocatedData = static_cast<HeapBlock<char, true>&&> (other.allocatedData);
allocatedData = std::move (other.allocatedData);
isClear = other.isClear; isClear = other.isClear;
if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) if (numChannels < (int) numElementsInArray (preallocatedChannelSpace))


+ 2
- 2
modules/juce_audio_basics/midi/juce_MidiFile.cpp View File

@@ -169,14 +169,14 @@ MidiFile& MidiFile::operator= (const MidiFile& other)
} }
MidiFile::MidiFile (MidiFile&& other) MidiFile::MidiFile (MidiFile&& other)
: tracks (static_cast<OwnedArray<MidiMessageSequence>&&> (other.tracks)),
: tracks (std::move (other.tracks)),
timeFormat (other.timeFormat) timeFormat (other.timeFormat)
{ {
} }
MidiFile& MidiFile::operator= (MidiFile&& other) MidiFile& MidiFile::operator= (MidiFile&& other)
{ {
tracks = static_cast<OwnedArray<MidiMessageSequence>&&> (other.tracks);
tracks = std::move (other.tracks);
timeFormat = other.timeFormat; timeFormat = other.timeFormat;
return *this; return *this;
} }


+ 4
- 4
modules/juce_audio_basics/midi/juce_MidiMessageSequence.cpp View File

@@ -24,7 +24,7 @@ namespace juce
{ {
MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& mm) : message (mm) {} MidiMessageSequence::MidiEventHolder::MidiEventHolder (const MidiMessage& mm) : message (mm) {}
MidiMessageSequence::MidiEventHolder::MidiEventHolder (MidiMessage&& mm) : message (static_cast<MidiMessage&&> (mm)) {}
MidiMessageSequence::MidiEventHolder::MidiEventHolder (MidiMessage&& mm) : message (std::move (mm)) {}
MidiMessageSequence::MidiEventHolder::~MidiEventHolder() {} MidiMessageSequence::MidiEventHolder::~MidiEventHolder() {}
//============================================================================== //==============================================================================
@@ -53,13 +53,13 @@ MidiMessageSequence& MidiMessageSequence::operator= (const MidiMessageSequence&
} }
MidiMessageSequence::MidiMessageSequence (MidiMessageSequence&& other) noexcept MidiMessageSequence::MidiMessageSequence (MidiMessageSequence&& other) noexcept
: list (static_cast<OwnedArray<MidiEventHolder>&&> (other.list))
: list (std::move (other.list))
{ {
} }
MidiMessageSequence& MidiMessageSequence::operator= (MidiMessageSequence&& other) noexcept MidiMessageSequence& MidiMessageSequence::operator= (MidiMessageSequence&& other) noexcept
{ {
list = static_cast<OwnedArray<MidiEventHolder>&&> (other.list);
list = std::move (other.list);
return *this; return *this;
} }
@@ -174,7 +174,7 @@ MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (const MidiM
MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (MidiMessage&& newMessage, double timeAdjustment) MidiMessageSequence::MidiEventHolder* MidiMessageSequence::addEvent (MidiMessage&& newMessage, double timeAdjustment)
{ {
return addEvent (new MidiEventHolder (static_cast<MidiMessage&&> (newMessage)), timeAdjustment);
return addEvent (new MidiEventHolder (std::move (newMessage)), timeAdjustment);
} }
void MidiMessageSequence::deleteEvent (int index, bool deleteMatchingNoteUp) void MidiMessageSequence::deleteEvent (int index, bool deleteMatchingNoteUp)


+ 6
- 6
modules/juce_audio_devices/native/juce_android_OpenSL.cpp View File

@@ -88,12 +88,12 @@ public:
//============================================================================== //==============================================================================
SlObjectRef() noexcept {} SlObjectRef() noexcept {}
SlObjectRef (const SlObjectRef& obj) noexcept : cb (obj.cb) {} SlObjectRef (const SlObjectRef& obj) noexcept : cb (obj.cb) {}
SlObjectRef (SlObjectRef&& obj) noexcept : cb (static_cast<ReferenceCountedObjectPtr<ControlBlock>&&> (obj.cb)) { obj.cb = nullptr; }
SlObjectRef (SlObjectRef&& obj) noexcept : cb (std::move (obj.cb)) { obj.cb = nullptr; }
explicit SlObjectRef (SLObjectItf o) : cb (new ControlBlock (o)) {} explicit SlObjectRef (SLObjectItf o) : cb (new ControlBlock (o)) {}
//============================================================================== //==============================================================================
SlObjectRef& operator= (const SlObjectRef& r) noexcept { cb = r.cb; return *this; } SlObjectRef& operator= (const SlObjectRef& r) noexcept { cb = r.cb; return *this; }
SlObjectRef& operator= (SlObjectRef&& r) noexcept { cb = static_cast<ReferenceCountedObjectPtr<ControlBlock>&&> (r.cb); r.cb = nullptr; return *this; }
SlObjectRef& operator= (SlObjectRef&& r) noexcept { cb = std::move (r.cb); r.cb = nullptr; return *this; }
SlObjectRef& operator= (std::nullptr_t) noexcept { cb = nullptr; return *this; } SlObjectRef& operator= (std::nullptr_t) noexcept { cb = nullptr; return *this; }
//============================================================================== //==============================================================================
@@ -125,11 +125,11 @@ public:
//============================================================================== //==============================================================================
SlRef() noexcept {} SlRef() noexcept {}
SlRef (const SlRef& r) noexcept : SlObjectRef (r), type (r.type) {} SlRef (const SlRef& r) noexcept : SlObjectRef (r), type (r.type) {}
SlRef (SlRef&& r) noexcept : SlObjectRef (static_cast<SlRef&&> (r)), type (r.type) { r.type = nullptr; }
SlRef (SlRef&& r) noexcept : SlObjectRef (std::move (r)), type (r.type) { r.type = nullptr; }
//============================================================================== //==============================================================================
SlRef& operator= (const SlRef& r) noexcept { SlObjectRef::operator= (r); type = r.type; return *this; } SlRef& operator= (const SlRef& r) noexcept { SlObjectRef::operator= (r); type = r.type; return *this; }
SlRef& operator= (SlRef&& r) noexcept { SlObjectRef::operator= (static_cast<SlObjectRef&&> (r)); type = r.type; r.type = nullptr; return *this; }
SlRef& operator= (SlRef&& r) noexcept { SlObjectRef::operator= (std::move (r)); type = r.type; r.type = nullptr; return *this; }
SlRef& operator= (std::nullptr_t) noexcept { SlObjectRef::operator= (nullptr); type = nullptr; return *this; } SlRef& operator= (std::nullptr_t) noexcept { SlObjectRef::operator= (nullptr); type = nullptr; return *this; }
//============================================================================== //==============================================================================
@@ -139,7 +139,7 @@ public:
//============================================================================== //==============================================================================
static SlRef cast (SlObjectRef& base) { return SlRef (base); } static SlRef cast (SlObjectRef& base) { return SlRef (base); }
static SlRef cast (SlObjectRef&& base) { return SlRef (static_cast<SlObjectRef&&> (base)); }
static SlRef cast (SlObjectRef&& base) { return SlRef (std::move (base)); }
private: private:
SlRef (SlObjectRef& base) : SlObjectRef (base) SlRef (SlObjectRef& base) : SlObjectRef (base)
@@ -155,7 +155,7 @@ private:
*this = nullptr; *this = nullptr;
} }
SlRef (SlObjectRef&& base) : SlObjectRef (static_cast<SlObjectRef&&> (base))
SlRef (SlObjectRef&& base) : SlObjectRef (std::move (base))
{ {
if (auto obj = SlObjectRef::operator->()) if (auto obj = SlObjectRef::operator->())
{ {


+ 2
- 2
modules/juce_audio_processors/format_types/juce_VSTCommon.h View File

@@ -145,7 +145,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e
VstSpeakerConfigurationHolder (const Vst2::VstSpeakerArrangement& vstConfig) { operator= (vstConfig); } VstSpeakerConfigurationHolder (const Vst2::VstSpeakerArrangement& vstConfig) { operator= (vstConfig); }
VstSpeakerConfigurationHolder (const VstSpeakerConfigurationHolder& other) { operator= (other.get()); } VstSpeakerConfigurationHolder (const VstSpeakerConfigurationHolder& other) { operator= (other.get()); }
VstSpeakerConfigurationHolder (VstSpeakerConfigurationHolder&& other) VstSpeakerConfigurationHolder (VstSpeakerConfigurationHolder&& other)
: storage (static_cast<HeapBlock<Vst2::VstSpeakerArrangement>&&> (other.storage)) { other.clear(); }
: storage (std::move (other.storage)) { other.clear(); }
VstSpeakerConfigurationHolder (const AudioChannelSet& channels) VstSpeakerConfigurationHolder (const AudioChannelSet& channels)
{ {
@@ -180,7 +180,7 @@ struct SpeakerMappings : private AudioChannelSet // (inheritance only to give e
VstSpeakerConfigurationHolder& operator= (VstSpeakerConfigurationHolder && vstConfig) VstSpeakerConfigurationHolder& operator= (VstSpeakerConfigurationHolder && vstConfig)
{ {
storage = static_cast<HeapBlock<Vst2::VstSpeakerArrangement>&&> (vstConfig.storage);
storage = std::move (vstConfig.storage);
vstConfig.clear(); vstConfig.clear();
return *this; return *this;


+ 2
- 2
modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp View File

@@ -191,13 +191,13 @@ private:
{ {
struct LambdaOp : public RenderingOp struct LambdaOp : public RenderingOp
{ {
LambdaOp (LambdaType&& f) : function (static_cast<LambdaType&&> (f)) {}
LambdaOp (LambdaType&& f) : function (std::move (f)) {}
void perform (const Context& c) override { function (c); } void perform (const Context& c) override { function (c); }
LambdaType function; LambdaType function;
}; };
renderOps.add (new LambdaOp (static_cast<LambdaType&&> (fn)));
renderOps.add (new LambdaOp (std::move (fn)));
} }
//============================================================================== //==============================================================================


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

@@ -49,14 +49,14 @@ public:
} }
ArrayAllocationBase (ArrayAllocationBase&& other) noexcept ArrayAllocationBase (ArrayAllocationBase&& other) noexcept
: elements (static_cast<HeapBlock<ElementType>&&> (other.elements)),
: elements (std::move (other.elements)),
numAllocated (other.numAllocated) numAllocated (other.numAllocated)
{ {
} }
ArrayAllocationBase& operator= (ArrayAllocationBase&& other) noexcept ArrayAllocationBase& operator= (ArrayAllocationBase&& other) noexcept
{ {
elements = static_cast<HeapBlock<ElementType>&&> (other.elements);
elements = std::move (other.elements);
numAllocated = other.numAllocated; numAllocated = other.numAllocated;
return *this; return *this;
} }


+ 11
- 11
modules/juce_core/containers/juce_NamedValueSet.cpp View File

@@ -30,24 +30,24 @@ NamedValueSet::NamedValue::NamedValue (const Identifier& n, const var& v) : nam
NamedValueSet::NamedValue::NamedValue (const NamedValue& other) : NamedValue (other.name, other.value) {} NamedValueSet::NamedValue::NamedValue (const NamedValue& other) : NamedValue (other.name, other.value) {}
NamedValueSet::NamedValue::NamedValue (NamedValue&& other) noexcept NamedValueSet::NamedValue::NamedValue (NamedValue&& other) noexcept
: NamedValue (static_cast<Identifier&&> (other.name),
static_cast<var&&> (other.value))
: NamedValue (std::move (other.name),
std::move (other.value))
{} {}
NamedValueSet::NamedValue::NamedValue (const Identifier& n, var&& v) noexcept NamedValueSet::NamedValue::NamedValue (const Identifier& n, var&& v) noexcept
: name (n), value (static_cast<var&&> (v))
: name (n), value (std::move (v))
{ {
} }
NamedValueSet::NamedValue::NamedValue (Identifier&& n, var&& v) noexcept NamedValueSet::NamedValue::NamedValue (Identifier&& n, var&& v) noexcept
: name (static_cast<Identifier&&> (n)),
value (static_cast<var&&> (v))
: name (std::move (n)),
value (std::move (v))
{} {}
NamedValueSet::NamedValue& NamedValueSet::NamedValue::operator= (NamedValue&& other) noexcept NamedValueSet::NamedValue& NamedValueSet::NamedValue::operator= (NamedValue&& other) noexcept
{ {
name = static_cast<Identifier&&> (other.name);
value = static_cast<var&&> (other.value);
name = std::move (other.name);
value = std::move (other.value);
return *this; return *this;
} }
@@ -61,10 +61,10 @@ NamedValueSet::~NamedValueSet() noexcept {}
NamedValueSet::NamedValueSet (const NamedValueSet& other) : values (other.values) {} NamedValueSet::NamedValueSet (const NamedValueSet& other) : values (other.values) {}
NamedValueSet::NamedValueSet (NamedValueSet&& other) noexcept NamedValueSet::NamedValueSet (NamedValueSet&& other) noexcept
: values (static_cast<Array<NamedValue>&&> (other.values)) {}
: values (std::move (other.values)) {}
NamedValueSet::NamedValueSet (std::initializer_list<NamedValue> list) NamedValueSet::NamedValueSet (std::initializer_list<NamedValue> list)
: values (static_cast<std::initializer_list<NamedValue>&&> (list))
: values (std::move (list))
{ {
} }
@@ -163,11 +163,11 @@ bool NamedValueSet::set (const Identifier& name, var&& newValue)
if (v->equalsWithSameType (newValue)) if (v->equalsWithSameType (newValue))
return false; return false;
*v = static_cast<var&&> (newValue);
*v = std::move (newValue);
return true; return true;
} }
values.add ({ name, static_cast<var&&> (newValue) });
values.add ({ name, std::move (newValue) });
return true; return true;
} }


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

@@ -66,14 +66,14 @@ public:
/** Creates a copy of another set. */ /** Creates a copy of another set. */
// VS2013 doesn't allow defaulted noexcept constructors. // VS2013 doesn't allow defaulted noexcept constructors.
SortedSet (SortedSet&& other) noexcept : data (static_cast<decltype(data)&&> (other.data)) {}
SortedSet (SortedSet&& other) noexcept : data (std::move (other.data)) {}
/** Makes a copy of another set. */ /** Makes a copy of another set. */
SortedSet& operator= (const SortedSet&) = default; SortedSet& operator= (const SortedSet&) = default;
/** Makes a copy of another set. */ /** Makes a copy of another set. */
// VS2013 doesn't allow defaulted noexcept constructors. // VS2013 doesn't allow defaulted noexcept constructors.
SortedSet& operator= (SortedSet&& other) noexcept { data = static_cast<decltype(data)&&> (other.data); return *this; }
SortedSet& operator= (SortedSet&& other) noexcept { data = std::move (other.data); return *this; }
/** Destructor. */ /** Destructor. */
~SortedSet() noexcept {} ~SortedSet() noexcept {}


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

@@ -46,8 +46,8 @@ public:
SparseSet (const SparseSet&) = default; SparseSet (const SparseSet&) = default;
SparseSet& operator= (const SparseSet&) = default; SparseSet& operator= (const SparseSet&) = default;
SparseSet (SparseSet&& other) noexcept : ranges (static_cast<Array<Range<Type>>&&> (other.ranges)) {}
SparseSet& operator= (SparseSet&& other) noexcept { ranges = static_cast<Array<Range<Type>>&&> (other.ranges); return *this; }
SparseSet (SparseSet&& other) noexcept : ranges (std::move (other.ranges)) {}
SparseSet& operator= (SparseSet&& other) noexcept { ranges = std::move (other.ranges); return *this; }
//============================================================================== //==============================================================================
/** Clears the set. */ /** Clears the set. */


+ 5
- 5
modules/juce_core/containers/juce_Variant.cpp View File

@@ -363,7 +363,7 @@ public:
struct RefCountedArray : public ReferenceCountedObject struct RefCountedArray : public ReferenceCountedObject
{ {
RefCountedArray (const Array<var>& a) : array (a) { incReferenceCount(); } RefCountedArray (const Array<var>& a) : array (a) { incReferenceCount(); }
RefCountedArray (Array<var>&& a) : array (static_cast<Array<var>&&> (a)) { incReferenceCount(); }
RefCountedArray (Array<var>&& a) : array (std::move (a)) { incReferenceCount(); }
Array<var> array; Array<var> array;
}; };
}; };
@@ -543,24 +543,24 @@ var& var::operator= (var&& other) noexcept
var::var (String&& v) : type (&VariantType_String::instance) var::var (String&& v) : type (&VariantType_String::instance)
{ {
new (value.stringValue) String (static_cast<String&&> (v));
new (value.stringValue) String (std::move (v));
} }
var::var (MemoryBlock&& v) : type (&VariantType_Binary::instance) var::var (MemoryBlock&& v) : type (&VariantType_Binary::instance)
{ {
value.binaryValue = new MemoryBlock (static_cast<MemoryBlock&&> (v));
value.binaryValue = new MemoryBlock (std::move (v));
} }
var::var (Array<var>&& v) : type (&VariantType_Array::instance) var::var (Array<var>&& v) : type (&VariantType_Array::instance)
{ {
value.objectValue = new VariantType_Array::RefCountedArray (static_cast<Array<var>&&> (v));
value.objectValue = new VariantType_Array::RefCountedArray (std::move (v));
} }
var& var::operator= (String&& v) var& var::operator= (String&& v)
{ {
type->cleanUp (value); type->cleanUp (value);
type = &VariantType_String::instance; type = &VariantType_String::instance;
new (value.stringValue) String (static_cast<String&&> (v));
new (value.stringValue) String (std::move (v));
return *this; return *this;
} }


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

@@ -53,13 +53,13 @@ File& File::operator= (const File& other)
} }
File::File (File&& other) noexcept File::File (File&& other) noexcept
: fullPath (static_cast<String&&> (other.fullPath))
: fullPath (std::move (other.fullPath))
{ {
} }
File& File::operator= (File&& other) noexcept File& File::operator= (File&& other) noexcept
{ {
fullPath = static_cast<String&&> (other.fullPath);
fullPath = std::move (other.fullPath);
return *this; return *this;
} }


+ 2
- 2
modules/juce_core/javascript/juce_Javascript.cpp View File

@@ -132,8 +132,8 @@ struct JavascriptEngine::RootObject : public DynamicObject
struct Scope struct Scope
{ {
Scope (const Scope* p, ReferenceCountedObjectPtr<RootObject> rt, DynamicObject::Ptr scp) noexcept Scope (const Scope* p, ReferenceCountedObjectPtr<RootObject> rt, DynamicObject::Ptr scp) noexcept
: parent (p), root (static_cast<ReferenceCountedObjectPtr<RootObject>&&> (rt)),
scope (static_cast<DynamicObject::Ptr&&> (scp)) {}
: parent (p), root (std::move (rt)),
scope (std::move (scp)) {}
const Scope* const parent; const Scope* const parent;
ReferenceCountedObjectPtr<RootObject> root; ReferenceCountedObjectPtr<RootObject> root;


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

@@ -112,7 +112,7 @@ BigInteger::BigInteger (const BigInteger& other)
} }
BigInteger::BigInteger (BigInteger&& other) noexcept BigInteger::BigInteger (BigInteger&& other) noexcept
: heapAllocation (static_cast<HeapBlock<uint32>&&> (other.heapAllocation)),
: heapAllocation (std::move (other.heapAllocation)),
allocatedSize (other.allocatedSize), allocatedSize (other.allocatedSize),
highestBit (other.highestBit), highestBit (other.highestBit),
negative (other.negative) negative (other.negative)
@@ -122,7 +122,7 @@ BigInteger::BigInteger (BigInteger&& other) noexcept
BigInteger& BigInteger::operator= (BigInteger&& other) noexcept BigInteger& BigInteger::operator= (BigInteger&& other) noexcept
{ {
heapAllocation = static_cast<HeapBlock<uint32>&&> (other.heapAllocation);
heapAllocation = std::move (other.heapAllocation);
memcpy (preallocated, other.preallocated, sizeof (preallocated)); memcpy (preallocated, other.preallocated, sizeof (preallocated));
allocatedSize = other.allocatedSize; allocatedSize = other.allocatedSize;
highestBit = other.highestBit; highestBit = other.highestBit;


+ 3
- 3
modules/juce_core/maths/juce_Expression.cpp View File

@@ -133,7 +133,7 @@ struct Expression::Helpers
class BinaryTerm : public Term class BinaryTerm : public Term
{ {
public: public:
BinaryTerm (TermPtr l, TermPtr r) : left (static_cast<TermPtr&&> (l)), right (static_cast<TermPtr&&> (r))
BinaryTerm (TermPtr l, TermPtr r) : left (std::move (l)), right (std::move (r))
{ {
jassert (left != nullptr && right != nullptr); jassert (left != nullptr && right != nullptr);
} }
@@ -951,13 +951,13 @@ Expression& Expression::operator= (const Expression& other)
} }
Expression::Expression (Expression&& other) noexcept Expression::Expression (Expression&& other) noexcept
: term (static_cast<ReferenceCountedObjectPtr<Term>&&> (other.term))
: term (std::move (other.term))
{ {
} }
Expression& Expression::operator= (Expression&& other) noexcept Expression& Expression::operator= (Expression&& other) noexcept
{ {
term = static_cast<ReferenceCountedObjectPtr<Term>&&> (other.term);
term = std::move (other.term);
return *this; return *this;
} }


+ 6
- 6
modules/juce_core/maths/juce_NormalisableRange.h View File

@@ -50,9 +50,9 @@ public:
: start (other.start), end (other.end), : start (other.start), end (other.end),
interval (other.interval), skew (other.skew), interval (other.interval), skew (other.skew),
symmetricSkew (other.symmetricSkew), symmetricSkew (other.symmetricSkew),
convertFrom0To1Function (static_cast<ConversionFunction&&> (other.convertFrom0To1Function)),
convertTo0To1Function (static_cast<ConversionFunction&&> (other.convertTo0To1Function)),
snapToLegalValueFunction (static_cast<ConversionFunction&&> (other.snapToLegalValueFunction))
convertFrom0To1Function (std::move (other.convertFrom0To1Function)),
convertTo0To1Function (std::move (other.convertTo0To1Function)),
snapToLegalValueFunction (std::move (other.snapToLegalValueFunction))
{ {
} }
@@ -64,9 +64,9 @@ public:
interval = other.interval; interval = other.interval;
skew = other.skew; skew = other.skew;
symmetricSkew = other.symmetricSkew; symmetricSkew = other.symmetricSkew;
convertFrom0To1Function = static_cast<ConversionFunction&&> (other.convertFrom0To1Function);
convertTo0To1Function = static_cast<ConversionFunction&&> (other.convertTo0To1Function);
snapToLegalValueFunction = static_cast<ConversionFunction&&> (other.snapToLegalValueFunction);
convertFrom0To1Function = std::move (other.convertFrom0To1Function);
convertTo0To1Function = std::move (other.convertTo0To1Function);
snapToLegalValueFunction = std::move (other.snapToLegalValueFunction);
return *this; return *this;
} }


+ 2
- 2
modules/juce_core/memory/juce_MemoryBlock.cpp View File

@@ -81,14 +81,14 @@ MemoryBlock& MemoryBlock::operator= (const MemoryBlock& other)
} }
MemoryBlock::MemoryBlock (MemoryBlock&& other) noexcept MemoryBlock::MemoryBlock (MemoryBlock&& other) noexcept
: data (static_cast<HeapBlockType&&> (other.data)),
: data (std::move (other.data)),
size (other.size) size (other.size)
{ {
} }
MemoryBlock& MemoryBlock::operator= (MemoryBlock&& other) noexcept MemoryBlock& MemoryBlock::operator= (MemoryBlock&& other) noexcept
{ {
data = static_cast<HeapBlockType&&> (other.data);
data = std::move (other.data);
size = other.size; size = other.size;
return *this; return *this;
} }


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

@@ -87,7 +87,7 @@ public:
WeakReference (const WeakReference& other) noexcept : holder (other.holder) {} WeakReference (const WeakReference& other) noexcept : holder (other.holder) {}
/** Move constructor */ /** Move constructor */
WeakReference (WeakReference&& other) noexcept : holder (static_cast<SharedRef&&> (other.holder)) {}
WeakReference (WeakReference&& other) noexcept : holder (std::move (other.holder)) {}
/** Copies another pointer to this one. */ /** Copies another pointer to this one. */
WeakReference& operator= (const WeakReference& other) { holder = other.holder; return *this; } WeakReference& operator= (const WeakReference& other) { holder = other.holder; return *this; }
@@ -96,7 +96,7 @@ public:
WeakReference& operator= (ObjectType* newObject) { holder = getRef (newObject); return *this; } WeakReference& operator= (ObjectType* newObject) { holder = getRef (newObject); return *this; }
/** Move assignment operator */ /** Move assignment operator */
WeakReference& operator= (WeakReference&& other) noexcept { holder = static_cast<SharedRef&&> (other.holder); return *this; }
WeakReference& operator= (WeakReference&& other) noexcept { holder = std::move (other.holder); return *this; }
/** Returns the object that this pointer refers to, or null if the object no longer exists. */ /** 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; } ObjectType* get() const noexcept { return holder != nullptr ? holder->get() : nullptr; }


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

@@ -42,13 +42,13 @@ Result& Result::operator= (const Result& other)
} }
Result::Result (Result&& other) noexcept Result::Result (Result&& other) noexcept
: errorMessage (static_cast<String&&> (other.errorMessage))
: errorMessage (std::move (other.errorMessage))
{ {
} }
Result& Result::operator= (Result&& other) noexcept Result& Result::operator= (Result&& other) noexcept
{ {
errorMessage = static_cast<String&&> (other.errorMessage);
errorMessage = std::move (other.errorMessage);
return *this; return *this;
} }


+ 6
- 6
modules/juce_core/misc/juce_StdFunctionCompat.cpp View File

@@ -197,13 +197,13 @@ public:
beginTest ("move constructor"); beginTest ("move constructor");
std::unique_ptr<std::function<int()>> fStackTmp (new std::function<int()> (fStack)); std::unique_ptr<std::function<int()>> fStackTmp (new std::function<int()> (fStack));
std::function<int()> f1 (static_cast<std::function<int()>&&> (*fStackTmp));
std::function<int()> f1 (std::move (*fStackTmp));
fStackTmp.reset(); fStackTmp.reset();
expectEquals (f1(), 3); expectEquals (f1(), 3);
std::unique_ptr<std::function<int()>> fHeapTmp (new std::function<int()> (fHeap)); std::unique_ptr<std::function<int()>> fHeapTmp (new std::function<int()> (fHeap));
std::function<int()> f2 (static_cast<std::function<int()>&&> (*fHeapTmp));
std::function<int()> f2 (std::move (*fHeapTmp));
if (*fHeapTmp) if (*fHeapTmp)
expect (false); expect (false);
@@ -211,7 +211,7 @@ public:
expectEquals (f2(), FunctionTestsHelpers::BigData::bigDataSum); expectEquals (f2(), FunctionTestsHelpers::BigData::bigDataSum);
std::unique_ptr<std::function<int()>> fEmptyTmp (new std::function<int()>()); std::unique_ptr<std::function<int()>> fEmptyTmp (new std::function<int()>());
std::function<int()> f3 (static_cast<std::function<int()>&&> (*fEmptyTmp));
std::function<int()> f3 (std::move (*fEmptyTmp));
fEmptyTmp.reset(); fEmptyTmp.reset();
if (f3) if (f3)
expect (false); expect (false);
@@ -222,14 +222,14 @@ public:
std::function<int()> f1 (fHeap); std::function<int()> f1 (fHeap);
std::unique_ptr<std::function<int()>> fStackTmp (new std::function<int()> (fStack)); std::unique_ptr<std::function<int()>> fStackTmp (new std::function<int()> (fStack));
f1 = static_cast<std::function<int()>&&> (*fStackTmp);
f1 = std::move (*fStackTmp);
fStackTmp.reset(); fStackTmp.reset();
expectEquals (f1(), 3); expectEquals (f1(), 3);
std::function<int()> f2 (fStack); std::function<int()> f2 (fStack);
std::unique_ptr<std::function<int()>> fHeapTmp (new std::function<int()> (fHeap)); std::unique_ptr<std::function<int()>> fHeapTmp (new std::function<int()> (fHeap));
f2 = static_cast<std::function<int()>&&> (*fHeapTmp);
f2 = std::move (*fHeapTmp);
if (*fHeapTmp) if (*fHeapTmp)
expect (false); expect (false);
@@ -238,7 +238,7 @@ public:
std::function<int()> f3 (fHeap); std::function<int()> f3 (fHeap);
std::unique_ptr<std::function<int()>> fEmptyTmp (new std::function<int()>()); std::unique_ptr<std::function<int()>> fEmptyTmp (new std::function<int()>());
f3 = static_cast<std::function<int()>&&> (*fEmptyTmp);
f3 = std::move (*fEmptyTmp);
fEmptyTmp.reset(); fEmptyTmp.reset();
if (f3) if (f3)
expect (false); expect (false);


+ 1
- 1
modules/juce_core/native/juce_android_Files.cpp View File

@@ -484,7 +484,7 @@ OutputStream* juce_CreateContentURIOutputStream (const URL& url)
{ {
auto stream = AndroidContentUriResolver::getStreamForContentUri (url, false); auto stream = AndroidContentUriResolver::getStreamForContentUri (url, false);
return (stream.get() != 0 ? new AndroidContentUriOutputStream (static_cast<LocalRef<jobject>&&> (stream)) : nullptr);
return (stream.get() != 0 ? new AndroidContentUriOutputStream (std::move (stream)) : nullptr);
} }
//============================================================================== //==============================================================================


+ 12
- 12
modules/juce_core/network/juce_URL.cpp View File

@@ -209,26 +209,26 @@ void URL::init()
URL::URL (const String& u, int) : url (u) {} URL::URL (const String& u, int) : url (u) {}
URL::URL (URL&& other) URL::URL (URL&& other)
: url (static_cast<String&&> (other.url)),
postData (static_cast<MemoryBlock&&> (other.postData)),
parameterNames (static_cast<StringArray&&> (other.parameterNames)),
parameterValues (static_cast<StringArray&&> (other.parameterValues)),
filesToUpload (static_cast<ReferenceCountedArray<Upload>&&> (other.filesToUpload))
: url (std::move (other.url)),
postData (std::move (other.postData)),
parameterNames (std::move (other.parameterNames)),
parameterValues (std::move (other.parameterValues)),
filesToUpload (std::move (other.filesToUpload))
#if JUCE_IOS #if JUCE_IOS
, bookmark (static_cast<Bookmark::Ptr&&> (other.bookmark))
, bookmark (std::move (other.bookmark))
#endif #endif
{ {
} }
URL& URL::operator= (URL&& other) URL& URL::operator= (URL&& other)
{ {
url = static_cast<String&&> (other.url);
postData = static_cast<MemoryBlock&&> (other.postData);
parameterNames = static_cast<StringArray&&> (other.parameterNames);
parameterValues = static_cast<StringArray&&> (other.parameterValues);
filesToUpload = static_cast<ReferenceCountedArray<Upload>&&> (other.filesToUpload);
url = std::move (other.url);
postData = std::move (other.postData);
parameterNames = std::move (other.parameterNames);
parameterValues = std::move (other.parameterValues);
filesToUpload = std::move (other.filesToUpload);
#if JUCE_IOS #if JUCE_IOS
bookmark = static_cast<Bookmark::Ptr&&> (other.bookmark);
bookmark = std::move (other.bookmark);
#endif #endif
return *this; return *this;


+ 1
- 1
modules/juce_core/streams/juce_URLInputSource.cpp View File

@@ -29,7 +29,7 @@ URLInputSource::URLInputSource (const URL& url)
} }
URLInputSource::URLInputSource (URL&& url) URLInputSource::URLInputSource (URL&& url)
: u (static_cast<URL&&> (url))
: u (std::move (url))
{ {
} }


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

@@ -28,11 +28,11 @@ Identifier::~Identifier() noexcept {}
Identifier::Identifier (const Identifier& other) noexcept : name (other.name) {} Identifier::Identifier (const Identifier& other) noexcept : name (other.name) {}
Identifier::Identifier (Identifier&& other) noexcept : name (static_cast<String&&> (other.name)) {}
Identifier::Identifier (Identifier&& other) noexcept : name (std::move (other.name)) {}
Identifier& Identifier::operator= (Identifier&& other) noexcept Identifier& Identifier::operator= (Identifier&& other) noexcept
{ {
name = static_cast<String&&> (other.name);
name = std::move (other.name);
return *this; return *this;
} }


+ 7
- 7
modules/juce_core/text/juce_String.cpp View File

@@ -1422,7 +1422,7 @@ String String::replaceCharacter (const juce_wchar charToReplace, const juce_wcha
break; break;
} }
return static_cast<String&&> (builder.result);
return std::move (builder.result);
} }
String String::replaceCharacters (StringRef charactersToReplace, StringRef charactersToInsertInstead) const String String::replaceCharacters (StringRef charactersToReplace, StringRef charactersToInsertInstead) const
@@ -1447,7 +1447,7 @@ String String::replaceCharacters (StringRef charactersToReplace, StringRef chara
break; break;
} }
return static_cast<String&&> (builder.result);
return std::move (builder.result);
} }
//============================================================================== //==============================================================================
@@ -1529,7 +1529,7 @@ String String::toUpperCase() const
++(builder.source); ++(builder.source);
} }
return static_cast<String&&> (builder.result);
return std::move (builder.result);
} }
String String::toLowerCase() const String String::toLowerCase() const
@@ -1547,7 +1547,7 @@ String String::toLowerCase() const
++(builder.source); ++(builder.source);
} }
return static_cast<String&&> (builder.result);
return std::move (builder.result);
} }
//============================================================================== //==============================================================================
@@ -1812,7 +1812,7 @@ String String::retainCharacters (StringRef charactersToRetain) const
} }
builder.write (0); builder.write (0);
return static_cast<String&&> (builder.result);
return std::move (builder.result);
} }
String String::removeCharacters (StringRef charactersToRemove) const String String::removeCharacters (StringRef charactersToRemove) const
@@ -1833,7 +1833,7 @@ String String::removeCharacters (StringRef charactersToRemove) const
break; break;
} }
return static_cast<String&&> (builder.result);
return std::move (builder.result);
} }
String String::initialSectionContainingOnly (StringRef permittedCharacters) const String String::initialSectionContainingOnly (StringRef permittedCharacters) const
@@ -2049,7 +2049,7 @@ String String::createStringFromData (const void* const unknownData, int size)
} }
builder.write (0); builder.write (0);
return static_cast<String&&> (builder.result);
return std::move (builder.result);
} }
auto* start = (const char*) data; auto* start = (const char*) data;


+ 3
- 3
modules/juce_core/text/juce_StringArray.cpp View File

@@ -33,12 +33,12 @@ StringArray::StringArray (const StringArray& other)
} }
StringArray::StringArray (StringArray&& other) noexcept StringArray::StringArray (StringArray&& other) noexcept
: strings (static_cast<Array<String>&&> (other.strings))
: strings (std::move (other.strings))
{ {
} }
StringArray::StringArray (Array<String>&& other) noexcept StringArray::StringArray (Array<String>&& other) noexcept
: strings (static_cast<Array<String>&&> (other))
: strings (std::move (other))
{ {
} }
@@ -85,7 +85,7 @@ StringArray& StringArray::operator= (const StringArray& other)
StringArray& StringArray::operator= (StringArray&& other) noexcept StringArray& StringArray::operator= (StringArray&& other) noexcept
{ {
strings = static_cast<Array<String>&&> (other.strings);
strings = std::move (other.strings);
return *this; return *this;
} }


+ 8
- 8
modules/juce_core/xml/juce_XmlElement.cpp View File

@@ -127,10 +127,10 @@ XmlElement& XmlElement::operator= (const XmlElement& other)
} }
XmlElement::XmlElement (XmlElement&& other) noexcept XmlElement::XmlElement (XmlElement&& other) noexcept
: nextListItem (static_cast<LinkedListPointer<XmlElement>&&> (other.nextListItem)),
firstChildElement (static_cast<LinkedListPointer<XmlElement>&&> (other.firstChildElement)),
attributes (static_cast<LinkedListPointer<XmlAttributeNode>&&> (other.attributes)),
tagName (static_cast<String&&> (other.tagName))
: nextListItem (std::move (other.nextListItem)),
firstChildElement (std::move (other.firstChildElement)),
attributes (std::move (other.attributes)),
tagName (std::move (other.tagName))
{ {
} }
@@ -141,10 +141,10 @@ XmlElement& XmlElement::operator= (XmlElement&& other) noexcept
removeAllAttributes(); removeAllAttributes();
deleteAllChildElements(); deleteAllChildElements();
nextListItem = static_cast<LinkedListPointer<XmlElement>&&> (other.nextListItem);
firstChildElement = static_cast<LinkedListPointer<XmlElement>&&> (other.firstChildElement);
attributes = static_cast<LinkedListPointer<XmlAttributeNode>&&> (other.attributes);
tagName = static_cast<String&&> (other.tagName);
nextListItem = std::move (other.nextListItem);
firstChildElement = std::move (other.firstChildElement);
attributes = std::move (other.attributes);
tagName = std::move (other.tagName);
return *this; return *this;
} }


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

@@ -123,7 +123,7 @@ Value::Value (Value&& other) noexcept
jassert (other.listeners.size() == 0); jassert (other.listeners.size() == 0);
other.removeFromListenerList(); other.removeFromListenerList();
value = static_cast<ReferenceCountedObjectPtr<ValueSource>&&> (other.value);
value = std::move (other.value);
} }
Value& Value::operator= (Value&& other) noexcept Value& Value::operator= (Value&& other) noexcept
@@ -133,7 +133,7 @@ Value& Value::operator= (Value&& other) noexcept
jassert (other.listeners.size() == 0); jassert (other.listeners.size() == 0);
other.removeFromListenerList(); other.removeFromListenerList();
value = static_cast<ReferenceCountedObjectPtr<ValueSource>&&> (other.value);
value = std::move (other.value);
return *this; return *this;
} }


+ 5
- 5
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -414,7 +414,7 @@ public:
SetPropertyAction (Ptr targetObject, const Identifier& propertyName, SetPropertyAction (Ptr targetObject, const Identifier& propertyName,
const var& newVal, const var& oldVal, bool isAdding, bool isDeleting, const var& newVal, const var& oldVal, bool isAdding, bool isDeleting,
ValueTree::Listener* listenerToExclude = nullptr) ValueTree::Listener* listenerToExclude = nullptr)
: target (static_cast<Ptr&&> (targetObject)),
: target (std::move (targetObject)),
name (propertyName), newValue (newVal), oldValue (oldVal), name (propertyName), newValue (newVal), oldValue (oldVal),
isAddingNewProperty (isAdding), isDeletingProperty (isDeleting), isAddingNewProperty (isAdding), isDeletingProperty (isDeleting),
excludeListener (listenerToExclude) excludeListener (listenerToExclude)
@@ -476,7 +476,7 @@ public:
struct AddOrRemoveChildAction : public UndoableAction struct AddOrRemoveChildAction : public UndoableAction
{ {
AddOrRemoveChildAction (Ptr parentObject, int index, SharedObject* newChild) AddOrRemoveChildAction (Ptr parentObject, int index, SharedObject* newChild)
: target (static_cast<Ptr&&> (parentObject)),
: target (std::move (parentObject)),
child (newChild != nullptr ? newChild : target->children.getObjectPointer (index)), child (newChild != nullptr ? newChild : target->children.getObjectPointer (index)),
childIndex (index), childIndex (index),
isDeleting (newChild == nullptr) isDeleting (newChild == nullptr)
@@ -528,7 +528,7 @@ public:
struct MoveChildAction : public UndoableAction struct MoveChildAction : public UndoableAction
{ {
MoveChildAction (Ptr parentObject, int fromIndex, int toIndex) noexcept MoveChildAction (Ptr parentObject, int fromIndex, int toIndex) noexcept
: parent (static_cast<Ptr&&> (parentObject)), startIndex (fromIndex), endIndex (toIndex)
: parent (std::move (parentObject)), startIndex (fromIndex), endIndex (toIndex)
{ {
} }
@@ -598,7 +598,7 @@ ValueTree::ValueTree (const Identifier& type,
addChild (tree, -1, nullptr); addChild (tree, -1, nullptr);
} }
ValueTree::ValueTree (SharedObject::Ptr so) noexcept : object (static_cast<SharedObject::Ptr&&> (so)) {}
ValueTree::ValueTree (SharedObject::Ptr so) noexcept : object (std::move (so)) {}
ValueTree::ValueTree (SharedObject& so) noexcept : object (so) {} ValueTree::ValueTree (SharedObject& so) noexcept : object (so) {}
ValueTree::ValueTree (const ValueTree& other) noexcept : object (other.object) ValueTree::ValueTree (const ValueTree& other) noexcept : object (other.object)
@@ -631,7 +631,7 @@ ValueTree& ValueTree::operator= (const ValueTree& other)
} }
ValueTree::ValueTree (ValueTree&& other) noexcept ValueTree::ValueTree (ValueTree&& other) noexcept
: object (static_cast<SharedObject::Ptr&&> (other.object))
: object (std::move (other.object))
{ {
if (object != nullptr) if (object != nullptr)
object->valueTreesWithListeners.removeValue (&other); object->valueTreesWithListeners.removeValue (&other);


+ 1
- 1
modules/juce_dsp/frequency/juce_FFT.cpp View File

@@ -632,7 +632,7 @@ struct FFTWImpl : public FFT::Instance
if (! Symbols::symbol (lib, symbols.execute_c2r_fftw, "fftwf_execute_dft_c2r")) return nullptr; if (! Symbols::symbol (lib, symbols.execute_c2r_fftw, "fftwf_execute_dft_c2r")) return nullptr;
#endif #endif
return new FFTWImpl (static_cast<size_t> (order), static_cast<DynamicLibrary&&> (lib), symbols);
return new FFTWImpl (std::move (lib), symbols);
} }
return nullptr; return nullptr;


+ 1
- 1
modules/juce_dsp/processors/juce_FIRFilter.h View File

@@ -68,7 +68,7 @@ namespace FIR
Filter() : coefficients (new Coefficients<NumericType>) { reset(); } Filter() : coefficients (new Coefficients<NumericType>) { reset(); }
/** Creates a filter with a given set of coefficients. */ /** Creates a filter with a given set of coefficients. */
Filter (CoefficientsPtr coefficientsToUse) : coefficients (static_cast<CoefficientsPtr&&> (coefficientsToUse)) { reset(); }
Filter (CoefficientsPtr coefficientsToUse) : coefficients (std::move (coefficientsToUse)) { reset(); }
Filter (const Filter&) = default; Filter (const Filter&) = default;
Filter (Filter&&) = default; Filter (Filter&&) = default;


+ 1
- 1
modules/juce_dsp/processors/juce_IIRFilter_Impl.h View File

@@ -42,7 +42,7 @@ Filter<SampleType>::Filter()
} }
template <typename SampleType> template <typename SampleType>
Filter<SampleType>::Filter (CoefficientsPtr c) : coefficients (static_cast<CoefficientsPtr&&> (c))
Filter<SampleType>::Filter (CoefficientsPtr c) : coefficients (std::move (c))
{ {
reset(); reset();
} }


+ 1
- 1
modules/juce_dsp/processors/juce_ProcessorDuplicator.h View File

@@ -44,7 +44,7 @@ struct ProcessorDuplicator
{ {
ProcessorDuplicator() : state (new StateType()) {} ProcessorDuplicator() : state (new StateType()) {}
ProcessorDuplicator (StateType* stateToUse) : state (stateToUse) {} ProcessorDuplicator (StateType* stateToUse) : state (stateToUse) {}
ProcessorDuplicator (typename StateType::Ptr stateToUse) : state (static_cast<typename StateType::Ptr&&> (stateToUse)) {}
ProcessorDuplicator (typename StateType::Ptr stateToUse) : state (std::move (stateToUse)) {}
ProcessorDuplicator (const ProcessorDuplicator&) = default; ProcessorDuplicator (const ProcessorDuplicator&) = default;
ProcessorDuplicator (ProcessorDuplicator&&) = default; ProcessorDuplicator (ProcessorDuplicator&&) = default;


+ 1
- 1
modules/juce_dsp/processors/juce_StateVariableFilter.h View File

@@ -67,7 +67,7 @@ namespace StateVariableFilter
/** Creates a filter with default parameters. */ /** Creates a filter with default parameters. */
Filter() : parameters (new Parameters<NumericType>) { reset(); } Filter() : parameters (new Parameters<NumericType>) { reset(); }
Filter (ParametersPtr parametersToUse) : parameters (static_cast<ParametersPtr&&> (parametersToUse)) { reset(); }
Filter (ParametersPtr parametersToUse) : parameters (std::move (parametersToUse)) { reset(); }
/** Creates a copy of another filter. */ /** Creates a copy of another filter. */
Filter (const Filter&) = default; Filter (const Filter&) = default;


+ 1
- 1
modules/juce_events/native/juce_android_Messaging.cpp View File

@@ -84,7 +84,7 @@ struct AndroidMessageQueue : private Android::Runnable
bool post (MessageManager::MessageBase::Ptr&& message) bool post (MessageManager::MessageBase::Ptr&& message)
{ {
queue.add (static_cast<MessageManager::MessageBase::Ptr&& > (message));
queue.add (std::move (message));
// this will call us on the message thread // this will call us on the message thread
return handler.post (self.get()); return handler.post (self.get());


+ 2
- 2
modules/juce_graphics/colour/juce_ColourGradient.cpp View File

@@ -43,7 +43,7 @@ ColourGradient::ColourGradient (const ColourGradient& other)
ColourGradient::ColourGradient (ColourGradient&& other) noexcept ColourGradient::ColourGradient (ColourGradient&& other) noexcept
: point1 (other.point1), point2 (other.point2), isRadial (other.isRadial), : point1 (other.point1), point2 (other.point2), isRadial (other.isRadial),
colours (static_cast<Array<ColourPoint>&&> (other.colours))
colours (std::move (other.colours))
{} {}
ColourGradient& ColourGradient::operator= (const ColourGradient& other) ColourGradient& ColourGradient::operator= (const ColourGradient& other)
@@ -60,7 +60,7 @@ ColourGradient& ColourGradient::operator= (ColourGradient&& other) noexcept
point1 = other.point1; point1 = other.point1;
point2 = other.point2; point2 = other.point2;
isRadial = other.isRadial; isRadial = other.isRadial;
colours = static_cast<Array<ColourPoint>&&> (other.colours);
colours = std::move (other.colours);
return *this; return *this;
} }


+ 5
- 5
modules/juce_graphics/colour/juce_FillType.cpp View File

@@ -43,7 +43,7 @@ FillType::FillType (const ColourGradient& g)
} }
FillType::FillType (ColourGradient&& g) FillType::FillType (ColourGradient&& g)
: colour (0xff000000), gradient (new ColourGradient (static_cast<ColourGradient&&> (g)))
: colour (0xff000000), gradient (new ColourGradient (std::move (g)))
{ {
} }
@@ -75,8 +75,8 @@ FillType& FillType::operator= (const FillType& other)
FillType::FillType (FillType&& other) noexcept FillType::FillType (FillType&& other) noexcept
: colour (other.colour), : colour (other.colour),
gradient (static_cast<std::unique_ptr<ColourGradient>&&> (other.gradient)),
image (static_cast<Image&&> (other.image)),
gradient (std::move (other.gradient)),
image (std::move (other.image)),
transform (other.transform) transform (other.transform)
{ {
} }
@@ -86,8 +86,8 @@ FillType& FillType::operator= (FillType&& other) noexcept
jassert (this != &other); // hopefully the compiler should make this situation impossible! jassert (this != &other); // hopefully the compiler should make this situation impossible!
colour = other.colour; colour = other.colour;
gradient = static_cast<std::unique_ptr<ColourGradient>&&> (other.gradient);
image = static_cast<Image&&> (other.image);
gradient = std::move (other.gradient);
image = std::move (other.image);
transform = other.transform; transform = other.transform;
return *this; return *this;
} }


+ 1
- 1
modules/juce_graphics/contexts/juce_GraphicsContext.cpp View File

@@ -203,7 +203,7 @@ void Graphics::setGradientFill (const ColourGradient& gradient)
void Graphics::setGradientFill (ColourGradient&& gradient) void Graphics::setGradientFill (ColourGradient&& gradient)
{ {
setFillType (static_cast<ColourGradient&&> (gradient));
setFillType (std::move (gradient));
} }
void Graphics::setTiledImageFill (const Image& imageToUse, const int anchorX, const int anchorY, const float opacity) void Graphics::setTiledImageFill (const Image& imageToUse, const int anchorX, const int anchorY, const float opacity)


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

@@ -280,13 +280,13 @@ Font& Font::operator= (const Font& other) noexcept
} }
Font::Font (Font&& other) noexcept Font::Font (Font&& other) noexcept
: font (static_cast<ReferenceCountedObjectPtr<SharedFontInternal>&&> (other.font))
: font (std::move (other.font))
{ {
} }
Font& Font::operator= (Font&& other) noexcept Font& Font::operator= (Font&& other) noexcept
{ {
font = static_cast<ReferenceCountedObjectPtr<SharedFontInternal>&&> (other.font);
font = std::move (other.font);
return *this; return *this;
} }


+ 4
- 4
modules/juce_graphics/fonts/juce_GlyphArrangement.cpp View File

@@ -40,7 +40,7 @@ PositionedGlyph::PositionedGlyph (const Font& font_, juce_wchar character_, int
} }
PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept
: font (static_cast<Font&&> (other.font)),
: font (std::move (other.font)),
character (other.character), glyph (other.glyph), character (other.character), glyph (other.glyph),
x (other.x), y (other.y), w (other.w), whitespace (other.whitespace) x (other.x), y (other.y), w (other.w), whitespace (other.whitespace)
{ {
@@ -48,7 +48,7 @@ PositionedGlyph::PositionedGlyph (PositionedGlyph&& other) noexcept
PositionedGlyph& PositionedGlyph::operator= (PositionedGlyph&& other) noexcept PositionedGlyph& PositionedGlyph::operator= (PositionedGlyph&& other) noexcept
{ {
font = static_cast<Font&&> (other.font);
font = std::move (other.font);
character = other.character; character = other.character;
glyph = other.glyph; glyph = other.glyph;
x = other.x; x = other.x;
@@ -129,13 +129,13 @@ GlyphArrangement::GlyphArrangement()
} }
GlyphArrangement::GlyphArrangement (GlyphArrangement&& other) GlyphArrangement::GlyphArrangement (GlyphArrangement&& other)
: glyphs (static_cast<Array<PositionedGlyph>&&> (other.glyphs))
: glyphs (std::move (other.glyphs))
{ {
} }
GlyphArrangement& GlyphArrangement::operator= (GlyphArrangement&& other) GlyphArrangement& GlyphArrangement::operator= (GlyphArrangement&& other)
{ {
glyphs = static_cast<Array<PositionedGlyph>&&> (other.glyphs);
glyphs = std::move (other.glyphs);
return *this; return *this;
} }


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

@@ -168,7 +168,7 @@ TextLayout::TextLayout (const TextLayout& other)
} }
TextLayout::TextLayout (TextLayout&& other) noexcept TextLayout::TextLayout (TextLayout&& other) noexcept
: lines (static_cast<OwnedArray<Line>&&> (other.lines)),
: lines (std::move (other.lines)),
width (other.width), height (other.height), width (other.width), height (other.height),
justification (other.justification) justification (other.justification)
{ {
@@ -176,7 +176,7 @@ TextLayout::TextLayout (TextLayout&& other) noexcept
TextLayout& TextLayout::operator= (TextLayout&& other) noexcept TextLayout& TextLayout::operator= (TextLayout&& other) noexcept
{ {
lines = static_cast<OwnedArray<Line>&&> (other.lines);
lines = std::move (other.lines);
width = other.width; width = other.width;
height = other.height; height = other.height;
justification = other.justification; justification = other.justification;


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

@@ -132,7 +132,7 @@ Path& Path::operator= (const Path& other)
} }
Path::Path (Path&& other) noexcept Path::Path (Path&& other) noexcept
: data (static_cast<Array<float>&&> (other.data)),
: data (std::move (other.data)),
bounds (other.bounds), bounds (other.bounds),
useNonZeroWinding (other.useNonZeroWinding) useNonZeroWinding (other.useNonZeroWinding)
{ {
@@ -140,7 +140,7 @@ Path::Path (Path&& other) noexcept
Path& Path::operator= (Path&& other) noexcept Path& Path::operator= (Path&& other) noexcept
{ {
data = static_cast<Array<float>&&> (other.data);
data = std::move (other.data);
bounds = other.bounds; bounds = other.bounds;
useNonZeroWinding = other.useNonZeroWinding; useNonZeroWinding = other.useNonZeroWinding;
return *this; return *this;


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

@@ -69,14 +69,14 @@ public:
/** Move constructor */ /** Move constructor */
RectangleList (RectangleList&& other) noexcept RectangleList (RectangleList&& other) noexcept
: rects (static_cast<Array<RectangleType>&&> (other.rects))
: rects (std::move (other.rects))
{ {
} }
/** Move assignment operator */ /** Move assignment operator */
RectangleList& operator= (RectangleList&& other) noexcept RectangleList& operator= (RectangleList&& other) noexcept
{ {
rects = static_cast<Array<RectangleType>&&> (other.rects);
rects = std::move (other.rects);
return *this; return *this;
} }


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

@@ -158,7 +158,7 @@ class SubsectionPixelData : public ImagePixelData
public: public:
SubsectionPixelData (ImagePixelData::Ptr source, Rectangle<int> r) SubsectionPixelData (ImagePixelData::Ptr source, Rectangle<int> r)
: ImagePixelData (source->pixelFormat, r.getWidth(), r.getHeight()), : ImagePixelData (source->pixelFormat, r.getWidth(), r.getHeight()),
sourceImage (static_cast<ImagePixelData::Ptr&&> (source)), area (r)
sourceImage (std::move (source)), area (r)
{ {
} }
@@ -226,7 +226,7 @@ Image::Image() noexcept
} }
Image::Image (ReferenceCountedObjectPtr<ImagePixelData> instance) noexcept Image::Image (ReferenceCountedObjectPtr<ImagePixelData> instance) noexcept
: image (static_cast<ReferenceCountedObjectPtr<ImagePixelData>&&> (instance))
: image (std::move (instance))
{ {
} }


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

@@ -48,7 +48,7 @@ void DrawablePath::setPath (const Path& newPath)
void DrawablePath::setPath (Path&& newPath) void DrawablePath::setPath (Path&& newPath)
{ {
path = static_cast<Path&&> (newPath);
path = std::move (newPath);
pathChanged(); pathChanged();
} }


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

@@ -183,7 +183,7 @@ void ContentSharer::startNewShare (std::function<void (bool, const String&)> cal
// You need to pass a valid callback. // You need to pass a valid callback.
jassert (callbackToUse); jassert (callbackToUse);
callback = static_cast<std::function<void (bool, const String&)>&&> (callbackToUse);
callback = std::move (callbackToUse);
pimpl.reset (createPimpl()); pimpl.reset (createPimpl());
} }


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

@@ -178,7 +178,7 @@ void FileChooser::launchAsync (int flags, std::function<void (const FileChooser&
// you cannot run two file chooser dialog boxes at the same time // you cannot run two file chooser dialog boxes at the same time
jassert (asyncCallback == nullptr); jassert (asyncCallback == nullptr);
asyncCallback = static_cast<std::function<void (const FileChooser&)>&&> (callback);
asyncCallback = std::move (callback);
pimpl.reset (createPimpl (flags, previewComp)); pimpl.reset (createPimpl (flags, previewComp));
pimpl->launch(); pimpl->launch();


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

@@ -1136,7 +1136,7 @@ struct UWPUIViewSettings
return; return;
// move dll into member var // move dll into member var
comBaseDLL = static_cast<ComBaseModule&&> (dll);
comBaseDLL = std::move (dll);
} }
} }


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

@@ -73,13 +73,13 @@ RelativeCoordinate& RelativeCoordinate::operator= (const RelativeCoordinate& oth
} }
RelativeCoordinate::RelativeCoordinate (RelativeCoordinate&& other) noexcept RelativeCoordinate::RelativeCoordinate (RelativeCoordinate&& other) noexcept
: term (static_cast<Expression&&> (other.term))
: term (std::move (other.term))
{ {
} }
RelativeCoordinate& RelativeCoordinate::operator= (RelativeCoordinate&& other) noexcept RelativeCoordinate& RelativeCoordinate::operator= (RelativeCoordinate&& other) noexcept
{ {
term = static_cast<Expression&&> (other.term);
term = std::move (other.term);
return *this; return *this;
} }


+ 2
- 2
modules/juce_gui_basics/widgets/juce_TextEditor.cpp View File

@@ -77,9 +77,9 @@ public:
// VS2013 can't default move constructors // VS2013 can't default move constructors
UniformTextSection (UniformTextSection&& other) UniformTextSection (UniformTextSection&& other)
: font (static_cast<Font&&> (other.font)),
: font (std::move (other.font)),
colour (other.colour), colour (other.colour),
atoms (static_cast<Array<TextAtom>&&> (other.atoms))
atoms (std::move (other.atoms))
{ {
} }


+ 4
- 4
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -540,7 +540,7 @@ public:
struct BlockingWorker : public OpenGLContext::AsyncWorker struct BlockingWorker : public OpenGLContext::AsyncWorker
{ {
BlockingWorker (OpenGLContext::AsyncWorker::Ptr && workerToUse) BlockingWorker (OpenGLContext::AsyncWorker::Ptr && workerToUse)
: originalWorker (static_cast<OpenGLContext::AsyncWorker::Ptr&&> (workerToUse))
: originalWorker (std::move (workerToUse))
{} {}
void operator() (OpenGLContext& calleeContext) void operator() (OpenGLContext& calleeContext)
@@ -590,7 +590,7 @@ public:
{ {
if (shouldBlock) if (shouldBlock)
{ {
auto blocker = new BlockingWorker (static_cast<OpenGLContext::AsyncWorker::Ptr&&> (workerToUse));
auto blocker = new BlockingWorker (std::move (workerToUse));
OpenGLContext::AsyncWorker::Ptr worker (*blocker); OpenGLContext::AsyncWorker::Ptr worker (*blocker);
workQueue.add (worker); workQueue.add (worker);
@@ -601,7 +601,7 @@ public:
} }
else else
{ {
workQueue.add (static_cast<OpenGLContext::AsyncWorker::Ptr&&> (workerToUse));
workQueue.add (std::move (workerToUse));
messageManagerLock.abort(); messageManagerLock.abort();
context.triggerRepaint(); context.triggerRepaint();
@@ -1057,7 +1057,7 @@ size_t OpenGLContext::getImageCacheSize() const noexcept { return ima
void OpenGLContext::execute (OpenGLContext::AsyncWorker::Ptr workerToUse, bool shouldBlock) void OpenGLContext::execute (OpenGLContext::AsyncWorker::Ptr workerToUse, bool shouldBlock)
{ {
if (auto* c = getCachedImage()) if (auto* c = getCachedImage())
c->execute (static_cast<OpenGLContext::AsyncWorker::Ptr&&> (workerToUse), shouldBlock);
c->execute (std::move (workerToUse), shouldBlock);
else else
jassertfalse; // You must have attached the context to a component jassertfalse; // You must have attached the context to a component
} }


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

@@ -30,7 +30,7 @@ namespace juce
OSCArgument::OSCArgument (int32 v) : type (OSCTypes::int32), intValue (v) {} OSCArgument::OSCArgument (int32 v) : type (OSCTypes::int32), intValue (v) {}
OSCArgument::OSCArgument (float v) : type (OSCTypes::float32), floatValue (v) {} OSCArgument::OSCArgument (float v) : type (OSCTypes::float32), floatValue (v) {}
OSCArgument::OSCArgument (const String& s) : type (OSCTypes::string), stringValue (s) {} OSCArgument::OSCArgument (const String& s) : type (OSCTypes::string), stringValue (s) {}
OSCArgument::OSCArgument (MemoryBlock b) : type (OSCTypes::blob), blob (static_cast<MemoryBlock&&> (b)) {}
OSCArgument::OSCArgument (MemoryBlock b) : type (OSCTypes::blob), blob (std::move (b)) {}
OSCArgument::OSCArgument (OSCColour c) : type (OSCTypes::colour), intValue ((int32) c.toInt32()) {} OSCArgument::OSCArgument (OSCColour c) : type (OSCTypes::colour), intValue ((int32) c.toInt32()) {}
//============================================================================== //==============================================================================


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

@@ -82,7 +82,7 @@ void OSCMessage::clear()
void OSCMessage::addInt32 (int32 value) { arguments.add (OSCArgument (value)); } void OSCMessage::addInt32 (int32 value) { arguments.add (OSCArgument (value)); }
void OSCMessage::addFloat32 (float value) { arguments.add (OSCArgument (value)); } void OSCMessage::addFloat32 (float value) { arguments.add (OSCArgument (value)); }
void OSCMessage::addString (const String& value) { arguments.add (OSCArgument (value)); } void OSCMessage::addString (const String& value) { arguments.add (OSCArgument (value)); }
void OSCMessage::addBlob (MemoryBlock blob) { arguments.add (OSCArgument (static_cast<MemoryBlock&&> (blob))); }
void OSCMessage::addBlob (MemoryBlock blob) { arguments.add (OSCArgument (std::move (blob))); }
void OSCMessage::addColour (OSCColour colour) { arguments.add (OSCArgument (colour)); } void OSCMessage::addColour (OSCColour colour) { arguments.add (OSCArgument (colour)); }
void OSCMessage::addArgument (OSCArgument arg) { arguments.add (arg); } void OSCMessage::addArgument (OSCArgument arg) { arguments.add (arg); }


+ 1
- 1
modules/juce_video/capture/juce_CameraDevice.cpp View File

@@ -237,7 +237,7 @@ void CameraDevice::openDeviceAsync (int index, OpenCameraResultCallback resultCa
} }
#if JUCE_ANDROID || JUCE_IOS #if JUCE_ANDROID || JUCE_IOS
CameraFactory::getInstance().openCamera (index, static_cast<OpenCameraResultCallback&&> (resultCallback),
CameraFactory::getInstance().openCamera (index, std::move (resultCallback),
minWidth, minHeight, maxWidth, maxHeight, useHighQuality); minWidth, minHeight, maxWidth, maxHeight, useHighQuality);
#else #else
auto* device = openDevice (index, minWidth, minHeight, maxWidth, maxHeight, useHighQuality); auto* device = openDevice (index, minWidth, minHeight, maxWidth, maxHeight, useHighQuality);


+ 2
- 2
modules/juce_video/native/juce_android_CameraDevice.h View File

@@ -522,7 +522,7 @@ struct CameraDevice::Pimpl
void open (InternalOpenCameraResultCallback cameraOpenCallbackToUse) void open (InternalOpenCameraResultCallback cameraOpenCallbackToUse)
{ {
cameraOpenCallback = static_cast<InternalOpenCameraResultCallback&&> (cameraOpenCallbackToUse);
cameraOpenCallback = std::move (cameraOpenCallbackToUse);
// A valid camera open callback must be passed. // A valid camera open callback must be passed.
jassert (cameraOpenCallback != nullptr); jassert (cameraOpenCallback != nullptr);
@@ -578,7 +578,7 @@ struct CameraDevice::Pimpl
return; return;
} }
pictureTakenCallback = static_cast<std::function<void (const Image&)>&&> (pictureTakenCallbackToUse);
pictureTakenCallback = std::move (pictureTakenCallbackToUse);
triggerStillPictureCapture(); triggerStillPictureCapture();
} }


+ 2
- 2
modules/juce_video/native/juce_ios_CameraDevice.h View File

@@ -41,7 +41,7 @@ struct CameraDevice::Pimpl
void open (InternalOpenCameraResultCallback cameraOpenCallbackToUse) void open (InternalOpenCameraResultCallback cameraOpenCallbackToUse)
{ {
cameraOpenCallback = static_cast<InternalOpenCameraResultCallback&&> (cameraOpenCallbackToUse);
cameraOpenCallback = std::move (cameraOpenCallbackToUse);
if (cameraOpenCallback == nullptr) if (cameraOpenCallback == nullptr)
{ {
@@ -83,7 +83,7 @@ struct CameraDevice::Pimpl
return; return;
} }
pictureTakenCallback = static_cast<std::function<void (const Image&)>&&> (pictureTakenCallbackToUse);
pictureTakenCallback = std::move (pictureTakenCallbackToUse);
triggerStillPictureCapture(); triggerStillPictureCapture();
} }


+ 1
- 1
modules/juce_video/native/juce_mac_CameraDevice.h View File

@@ -131,7 +131,7 @@ struct CameraDevice::Pimpl
return; return;
} }
pictureTakenCallback = static_cast<std::function<void (const Image&)>&&> (pictureTakenCallbackToUse);
pictureTakenCallback = std::move (pictureTakenCallbackToUse);
triggerImageCapture(); triggerImageCapture();
} }


+ 1
- 1
modules/juce_video/native/juce_win32_CameraDevice.h View File

@@ -195,7 +195,7 @@ struct CameraDevice::Pimpl : public ChangeBroadcaster
if (pictureTakenCallbackToUse == nullptr) if (pictureTakenCallbackToUse == nullptr)
return; return;
pictureTakenCallback = static_cast<std::function<void (const Image&)>&&> (pictureTakenCallbackToUse);
pictureTakenCallback = std::move (pictureTakenCallbackToUse);
} }
addUser(); addUser();


Loading…
Cancel
Save