dolphin/Source/Core/AudioCommon
JosJuice 09f3f9b41a Remove NonCopyable
The class NonCopyable is, like the name says, supposed to disallow
copying. But should it allow moving?

For a long time, NonCopyable used to not allow moving. (It declared
a deleted copy constructor and assigment operator without declaring
a move constructor and assignment operator, making the compiler
implicitly delete the move constructor and assignment operator.)
That's fine if the classes that inherit from NonCopyable don't need
to be movable or if writing the move constructor and assignment
operator by hand is fine, but that's not the case for all classes,
as I discovered when I was working on the DirectoryBlob PR.

Because of that, I decided to make NonCopyable movable in c7602cc,
allowing me to use NonCopyable in DirectoryBlob.h. That was however
an unfortunate decision, because some of the classes that inherit
from NonCopyable have incorrect behavior when moved by default-
generated move constructors and assignment operators, and do not
explicitly delete the move constructors and assignment operators,
relying on NonCopyable being non-movable.

So what can we do about this? There are four solutions that I can
think of:

1. Make NonCopyable non-movable and tell DirectoryBlob to suck it.

2. Keep allowing moving NonCopyable, and expect that classes that
   don't support moving will delete the move constructor and
   assignment operator manually. Not only is this inconsistent
   (having classes disallow copying one way and disallow moving
   another way), but deleting the move constructor and assignment
   operator manually is too easy to forget compared to how tricky
   the resulting problems are.

3. Have one "MovableNonCopyable" and one "NonMovableNonCopyable".
   It works, but it feels rather silly...

4. Don't have a NonCopyable class at all. Considering that deleting
   the copy constructor and assignment operator only takes two lines
   of code, I don't see much of a reason to keep NonCopyable. I
   suppose that there was more of a point in having NonCopyable back
   in the pre-C++11 days, when it wasn't possible to use "= delete".

I decided to go with the fourth one (like the commit title says).
The implementation of the commit is fairly straight-forward, though
I would like to point out that I skipped adding "= delete" lines
for classes whose only reason for being uncopyable is that they
contain uncopyable classes like File::IOFile and std::unique_ptr,
because the compiler makes such classes uncopyable automatically.
2017-08-22 16:40:34 +02:00
..
AlsaSoundStream.cpp Core: Remove double newlines at the end of *_LOG messages. 2016-11-02 02:09:33 +00:00
AlsaSoundStream.h Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
AudioCommon.cpp Remove CoreAudio audio backend 2017-06-29 16:53:20 -07:00
AudioCommon.h Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
AudioCommon.vcxproj Remove CoreAudio audio backend 2017-06-29 16:53:20 -07:00
AudioCommon.vcxproj.filters Remove CoreAudio audio backend 2017-06-29 16:53:20 -07:00
AudioStretcher.cpp AudioStretcher: split StretchAudio into ProcessSamples / GetStretchedSamples 2017-06-03 16:54:00 -07:00
AudioStretcher.h AudioStretcher: split StretchAudio into ProcessSamples / GetStretchedSamples 2017-06-03 16:54:00 -07:00
CMakeLists.txt Remove CoreAudio audio backend 2017-06-29 16:53:20 -07:00
CubebStream.cpp AudioCommon: move DPL2 decoding into Mixer 2017-06-03 16:53:59 -07:00
CubebStream.h CubebStream: Add missing <vector> include 2017-05-27 23:50:39 -04:00
CubebUtils.cpp Add CubebUtils namespace and hook up cubeb logging 2017-05-27 18:28:57 -07:00
CubebUtils.h Add CubebUtils namespace and hook up cubeb logging 2017-05-27 18:28:57 -07:00
DPL2Decoder.cpp DPL2Decoder: Prefer static_cast to C-style casts 2017-04-23 09:21:30 +01:00
DPL2Decoder.h Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Mixer.cpp Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
Mixer.h Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
NullSoundStream.cpp Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
NullSoundStream.h Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
OpenALStream.cpp Swapped C-style arrays to std::array 2017-06-27 07:12:15 -03:00
OpenALStream.h Removed redundant conversion to float when playing back stereo. 2017-06-27 07:10:32 -03:00
OpenSLESStream.cpp Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
OpenSLESStream.h Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
PulseAudioStream.cpp AudioCommon: move DPL2 decoding into Mixer 2017-06-03 16:53:59 -07:00
PulseAudioStream.h Use Common::Flag and Common::Event when possible 2016-08-10 16:08:15 +02:00
SoundStream.h Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
WaveFile.cpp Move IOFile to a separate file 2017-06-15 21:33:50 +02:00
WaveFile.h Remove NonCopyable 2017-08-22 16:40:34 +02:00
XAudio2_7Stream.cpp Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
XAudio2_7Stream.h Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
XAudio2Stream.cpp Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
XAudio2Stream.h Add includes for building on Windows without PCH 2017-01-23 01:37:41 -08:00