WebInputStream pimpl

Hey, I noticed that WebInputStream’s pimpl is a raw pointer.

It doesn’t need to be:

you can use a std::unique_ptr<Pimpl> as long as your WebInputStream’s destructor is defined in the cpp file where the Pimpl is defined.
It has to do with unique_ptr's destructor needing to know the full definition of Pimpl, during compilation.

Yeah, we know how to do that, of course! Lots of the old pimpl classes were implemented using raw deletes as a workaround in situations where older compilers failed to allow unique_ptr/ScopedPointer to delete private classes without having friend access to them. Since compilers moved on, that’s no longer necessary but there are probably a few places where the old code hasn’t been updated yet.


Hey @jules I had another Q for ya, about this class in juce_Variant.cpp

    struct RefCountedArray  : public ReferenceCountedObject
        RefCountedArray (const Array<var>& a)  : array (a)  { incReferenceCount(); }
        RefCountedArray (Array<var>&& a)  : array (std::move (a)) { incReferenceCount(); }
        Array<var> array;

Is there a particular reason the rule of 3/5 isn’t being followed?
Are you relying on the implicit RefCountedArray::operator=(Array<var>&& a) to perform correctly?
Or does defining that move constructor cause the copy ctor/copy assign/move assign functions to = delete; automatically?