We no longer use compilers that can't =default move construction and assignment
Review URL: https://codereview.webrtc.org/1891483006 Cr-Commit-Position: refs/heads/master@{#12376}
This commit is contained in:
@ -69,19 +69,12 @@ class Optional final {
|
||||
explicit Optional(T&& val) : value_(std::move(val)), has_value_(true) {}
|
||||
|
||||
// Copy and move constructors.
|
||||
// TODO(kwiberg): =default the move constructor when MSVC supports it.
|
||||
Optional(const Optional&) = default;
|
||||
Optional(Optional&& m)
|
||||
: value_(std::move(m.value_)), has_value_(m.has_value_) {}
|
||||
Optional(Optional&&) = default;
|
||||
|
||||
// Assignment.
|
||||
// TODO(kwiberg): =default the move assignment op when MSVC supports it.
|
||||
Optional& operator=(const Optional&) = default;
|
||||
Optional& operator=(Optional&& m) {
|
||||
value_ = std::move(m.value_);
|
||||
has_value_ = m.has_value_;
|
||||
return *this;
|
||||
}
|
||||
Optional& operator=(Optional&&) = default;
|
||||
|
||||
friend void swap(Optional& m1, Optional& m2) {
|
||||
using std::swap;
|
||||
|
||||
@ -37,17 +37,7 @@ std::unique_ptr<CNG_enc_inst, CngInstDeleter> CreateCngInst(
|
||||
} // namespace
|
||||
|
||||
AudioEncoderCng::Config::Config() = default;
|
||||
|
||||
// TODO(kwiberg): =default this when Visual Studio learns to handle it.
|
||||
AudioEncoderCng::Config::Config(Config&& c)
|
||||
: num_channels(c.num_channels),
|
||||
payload_type(c.payload_type),
|
||||
speech_encoder(std::move(c.speech_encoder)),
|
||||
vad_mode(c.vad_mode),
|
||||
sid_frame_interval_ms(c.sid_frame_interval_ms),
|
||||
num_cng_coefficients(c.num_cng_coefficients),
|
||||
vad(c.vad) {}
|
||||
|
||||
AudioEncoderCng::Config::Config(Config&&) = default;
|
||||
AudioEncoderCng::Config::~Config() = default;
|
||||
|
||||
bool AudioEncoderCng::Config::IsOk() const {
|
||||
|
||||
@ -19,12 +19,7 @@
|
||||
namespace webrtc {
|
||||
|
||||
AudioEncoderCopyRed::Config::Config() = default;
|
||||
|
||||
// TODO(kwiberg): =default this when Visual Studio learns to handle it.
|
||||
AudioEncoderCopyRed::Config::Config(Config&& c)
|
||||
: payload_type(c.payload_type),
|
||||
speech_encoder(std::move(c.speech_encoder)) {}
|
||||
|
||||
AudioEncoderCopyRed::Config::Config(Config&&) = default;
|
||||
AudioEncoderCopyRed::Config::~Config() = default;
|
||||
|
||||
AudioEncoderCopyRed::AudioEncoderCopyRed(Config&& config)
|
||||
|
||||
Reference in New Issue
Block a user