diff --git a/libaegisub/include/libaegisub/line_iterator.h b/libaegisub/include/libaegisub/line_iterator.h index 27e91c570..127014c76 100644 --- a/libaegisub/include/libaegisub/line_iterator.h +++ b/libaegisub/include/libaegisub/line_iterator.h @@ -33,7 +33,7 @@ namespace agi { /// @brief An iterator over lines in a stream template class line_iterator final : public std::iterator { - std::istream *stream; ///< Stream to iterator over + std::istream *stream = nullptr; ///< Stream to iterator over OutputType value; ///< Value to return when this is dereference std::shared_ptr conv; int cr; ///< CR character in the source encoding @@ -77,7 +77,7 @@ public: } /// @brief Invalid iterator constructor; use for end iterator - line_iterator() : stream(nullptr) { } + line_iterator() = default; /// @brief Copy constructor /// @param that line_iterator to copy from diff --git a/libaegisub/include/libaegisub/option_value.h b/libaegisub/include/libaegisub/option_value.h index cc2aaaf10..dcdcb0c23 100644 --- a/libaegisub/include/libaegisub/option_value.h +++ b/libaegisub/include/libaegisub/option_value.h @@ -88,10 +88,10 @@ class OptionValue { protected: void NotifyChanged() { ValueChanged(*this); } - OptionValue(std::string name) : name(std::move(name)) { } + OptionValue(std::string name) BOOST_NOEXCEPT : name(std::move(name)) { } public: - virtual ~OptionValue() {} + virtual ~OptionValue() = default; std::string GetName() const { return name; } virtual OptionType GetType() const = 0; diff --git a/libaegisub/include/libaegisub/signal.h b/libaegisub/include/libaegisub/signal.h index 6ef497b48..bf465ac53 100644 --- a/libaegisub/include/libaegisub/signal.h +++ b/libaegisub/include/libaegisub/signal.h @@ -49,10 +49,10 @@ namespace detail { class Connection { std::unique_ptr token; public: - Connection() { } - Connection(Connection&& that) : token(std::move(that.token)) { } - Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; } - Connection& operator=(Connection&& that) { token = std::move(that.token); return *this; } + Connection() = default; + Connection(Connection&& that) BOOST_NOEXCEPT : token(std::move(that.token)) { } + Connection(detail::ConnectionToken *token) BOOST_NOEXCEPT : token(token) { token->claimed = true; } + Connection& operator=(Connection&& that) BOOST_NOEXCEPT { token = std::move(that.token); return *this; } /// @brief End this connection /// diff --git a/src/ass_override.cpp b/src/ass_override.cpp index 1b7400006..bb7a540e1 100644 --- a/src/ass_override.cpp +++ b/src/ass_override.cpp @@ -55,6 +55,7 @@ AssOverrideParameter::AssOverrideParameter(VariableDataType type, AssParameterCl { } +#ifdef _MSC_VER AssOverrideParameter::AssOverrideParameter(AssOverrideParameter&& o) : value(std::move(o.value)) , block(std::move(o.block)) @@ -71,6 +72,7 @@ AssOverrideParameter& AssOverrideParameter::operator=(AssOverrideParameter&& rhs classification = rhs.classification; return *this; } +#endif AssOverrideParameter::~AssOverrideParameter() { } @@ -460,10 +462,11 @@ void AssDialogueBlockOverride::ProcessParameters(ProcessParametersCallback callb } } -AssOverrideTag::AssOverrideTag() : valid(false) { } AssOverrideTag::AssOverrideTag(std::string const& text) { SetText(text); } + +#ifdef _MSC_VER AssOverrideTag::AssOverrideTag(AssOverrideTag&& rhs) : valid(rhs.valid) , Name(std::move(rhs.Name)) @@ -477,6 +480,7 @@ AssOverrideTag& AssOverrideTag::operator=(AssOverrideTag&& rhs) { Params = std::move(rhs.Params); return *this; } +#endif void AssOverrideTag::Clear() { Params.clear(); diff --git a/src/ass_override.h b/src/ass_override.h index 3da32f525..d10b3b1d3 100644 --- a/src/ass_override.h +++ b/src/ass_override.h @@ -32,7 +32,6 @@ /// @ingroup subs_storage /// -#include #include #include @@ -62,15 +61,20 @@ enum class VariableDataType { }; /// A single parameter to an override tag -class AssOverrideParameter final : boost::noncopyable { +class AssOverrideParameter { std::string value; mutable std::unique_ptr block; VariableDataType type; public: AssOverrideParameter(VariableDataType type, AssParameterClass classification); +#ifdef _MSC_VER AssOverrideParameter(AssOverrideParameter&&); AssOverrideParameter& operator=(AssOverrideParameter&&); +#else + AssOverrideParameter(AssOverrideParameter&&) = default; + AssOverrideParameter& operator=(AssOverrideParameter&&) = default; +#endif ~AssOverrideParameter(); /// Type of parameter @@ -87,14 +91,19 @@ public: } }; -class AssOverrideTag final : boost::noncopyable { - bool valid; +class AssOverrideTag { + bool valid = false; public: - AssOverrideTag(); - AssOverrideTag(AssOverrideTag&&); + AssOverrideTag() = default; AssOverrideTag(std::string const& text); +#ifdef _MSC_VER + AssOverrideTag(AssOverrideTag&&); AssOverrideTag& operator=(AssOverrideTag&&); +#else + AssOverrideTag(AssOverrideTag&&) = default; + AssOverrideTag& operator=(AssOverrideTag&&) = default; +#endif std::string Name; std::vector Params; diff --git a/src/block_cache.h b/src/block_cache.h index 92e35fb2e..5e1b1c1c4 100644 --- a/src/block_cache.h +++ b/src/block_cache.h @@ -99,7 +99,7 @@ class DataBlockCache { BlockArray blocks; #ifdef _MSC_VER - MacroBlock() { } + MacroBlock() = default; MacroBlock(MacroBlock&& rgt) : position(rgt.position), blocks(std::move(rgt.blocks)) { } MacroBlock& operator=(MacroBlock&& rgt) { position = rgt.position; diff --git a/src/gl_text.cpp b/src/gl_text.cpp index 1a7bb778f..48c6bfa1c 100644 --- a/src/gl_text.cpp +++ b/src/gl_text.cpp @@ -187,7 +187,7 @@ public: TryToInsert(glyph); } - OpenGLTextTexture(OpenGLTextTexture&& rhs) + OpenGLTextTexture(OpenGLTextTexture&& rhs) BOOST_NOEXCEPT : x(rhs.x) , y(rhs.y) , nextY(rhs.nextY)