diff --git a/Foundation/include/Poco/Any.h b/Foundation/include/Poco/Any.h index 3a84c8b76..ce8e65985 100644 --- a/Foundation/include/Poco/Any.h +++ b/Foundation/include/Poco/Any.h @@ -78,7 +78,7 @@ public: #ifndef POCO_NO_SOO - Placeholder(): pHolder(0) + Placeholder(): pHolder(nullptr) { std::memset(holder, 0, sizeof(holder)); } @@ -111,7 +111,7 @@ public: } template::value>::type* = nullptr> + typename std::enable_if_t::value>* = nullptr> PlaceholderT* assign(const V& value) { erase(); @@ -121,7 +121,7 @@ public: } template::value>::type* = nullptr> + typename std::enable_if_t::value>* = nullptr> PlaceholderT* assign(const V& value) { erase(); @@ -139,7 +139,7 @@ public: } private: - typedef std::max_align_t AlignerType; + using AlignerType = std::max_align_t; static_assert(sizeof(AlignerType) <= SizeV + 1, "Aligner type is bigger than the actual storage, so SizeV should be made bigger otherwise you simply waste unused memory."); void setLocal(bool local) const @@ -172,7 +172,7 @@ private: #else // POCO_NO_SOO - Placeholder(): pHolder(0) + Placeholder(): pHolder(nullptr) { } @@ -189,12 +189,12 @@ private: void erase() { delete pHolder; - pHolder = 0; + pHolder = nullptr; } bool isEmpty() const { - return 0 == pHolder; + return nullptr == pHolder; } bool isLocal() const @@ -232,10 +232,8 @@ class Any { public: - Any() + Any() = default; /// Creates an empty any type. - { - } template Any(const ValueType & value) @@ -255,11 +253,9 @@ public: construct(other); } - ~Any() + ~Any() = default; /// Destructor. If Any is locally held, calls ValueHolder destructor; /// otherwise, deletes the placeholder from the heap. - { - } Any& swap(Any& other) noexcept /// Swaps the content of the two Anys. @@ -354,21 +350,19 @@ private: { } - virtual const std::type_info& type() const + Holder & operator = (const Holder &) = delete; + + const std::type_info& type() const override { return typeid(ValueType); } - virtual void clone(Placeholder* pPlaceholder) const + void clone(Placeholder* pPlaceholder) const override { pPlaceholder->assign, ValueType>(_held); } ValueType _held; - - private: - - Holder & operator = (const Holder &); }; ValueHolder* content() const diff --git a/Foundation/include/Poco/NumericString.h b/Foundation/include/Poco/NumericString.h index 0310b4f35..150aa1d4f 100644 --- a/Foundation/include/Poco/NumericString.h +++ b/Foundation/include/Poco/NumericString.h @@ -369,10 +369,10 @@ namespace Impl { }; template -using EnableSigned = typename std::enable_if< std::is_signed::value >::type*; +using EnableSigned = typename std::enable_if_t< std::is_signed::value >*; template -using EnableUnsigned = typename std::enable_if< std::is_unsigned::value >::type*; +using EnableUnsigned = typename std::enable_if_t< std::is_unsigned::value >*; } // namespace Impl