juce::var
has a constructor that takes a juce::ReferenceCountedObject*
which appears to take ownership of the object (although this isn’t documented AFAICS). This isn’t very modern-C++ and has led us to writing something like:
auto object = std::make_unique<juce::DynamicObject>();
// ...
juce::var v {object.release()};
However it’d be much nicer to be able to use std::move()
into the var
instead:
auto object = std::make_unique<juce::DynamicObject>();
// ...
juce::var v {std::move (object)};
Which would mean adding a juce::var(std::unique_ptr<juce::ReferenceCountedObject>)
constructor.