diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h index 0a17b0bf97f509..8336d85adf2eb6 100644 --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -1717,13 +1717,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp()> // 20.7.16.2.3, function capacity: _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} -private: - // deleted overloads close possible hole in the type system template - bool operator==(const function<_R2()>&) const;// = delete; + bool operator==(const function<_R2()>&) const = delete; template - bool operator!=(const function<_R2()>&) const;// = delete; -public: + bool operator!=(const function<_R2()>&) const = delete; + // 20.7.16.2.4, function invocation: _Rp operator()() const; @@ -1997,13 +1995,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)> // 20.7.16.2.3, function capacity: _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} -private: - // deleted overloads close possible hole in the type system template - bool operator==(const function<_R2(_B0)>&) const;// = delete; + bool operator==(const function<_R2(_B0)>&) const = delete; template - bool operator!=(const function<_R2(_B0)>&) const;// = delete; -public: + bool operator!=(const function<_R2(_B0)>&) const = delete; + // 20.7.16.2.4, function invocation: _Rp operator()(_A0) const; @@ -2277,13 +2273,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)> // 20.7.16.2.3, function capacity: _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} -private: - // deleted overloads close possible hole in the type system template - bool operator==(const function<_R2(_B0, _B1)>&) const;// = delete; + bool operator==(const function<_R2(_B0, _B1)>&) const = delete; template - bool operator!=(const function<_R2(_B0, _B1)>&) const;// = delete; -public: + bool operator!=(const function<_R2(_B0, _B1)>&) const = delete; + // 20.7.16.2.4, function invocation: _Rp operator()(_A0, _A1) const; @@ -2556,13 +2550,11 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)> // 20.7.16.2.3, function capacity: _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} -private: - // deleted overloads close possible hole in the type system template - bool operator==(const function<_R2(_B0, _B1, _B2)>&) const;// = delete; + bool operator==(const function<_R2(_B0, _B1, _B2)>&) const = delete; template - bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const;// = delete; -public: + bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const = delete; + // 20.7.16.2.4, function invocation: _Rp operator()(_A0, _A1, _A2) const; diff --git a/libcxx/include/__locale b/libcxx/include/__locale index 4296adbbd8e927..2582a90bb57816 100644 --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -208,10 +208,11 @@ class _LIBCPP_TYPE_VIS locale::id static int32_t __next_id; public: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR id() :__id_(0) {} + void operator=(const id&) = delete; + id(const id&) = delete; + private: void __init(); - void operator=(const id&); // = delete; - id(const id&); // = delete; public: // only needed for tests long __get(); diff --git a/libcxx/include/__mutex_base b/libcxx/include/__mutex_base index da2967164a681e..21e2075603b551 100644 --- a/libcxx/include/__mutex_base +++ b/libcxx/include/__mutex_base @@ -140,11 +140,9 @@ public: __m_->unlock(); } -private: - unique_lock(unique_lock const&); // = delete; - unique_lock& operator=(unique_lock const&); // = delete; + unique_lock(unique_lock const&) = delete; + unique_lock& operator=(unique_lock const&) = delete; -public: _LIBCPP_INLINE_VISIBILITY unique_lock(unique_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) diff --git a/libcxx/include/__random/random_device.h b/libcxx/include/__random/random_device.h index f62f7a3d269bbe..6a6b0cc306674e 100644 --- a/libcxx/include/__random/random_device.h +++ b/libcxx/include/__random/random_device.h @@ -56,10 +56,8 @@ class _LIBCPP_TYPE_VIS random_device // property functions double entropy() const _NOEXCEPT; -private: - // no copy functions - random_device(const random_device&); // = delete; - random_device& operator=(const random_device&); // = delete; + random_device(const random_device&) = delete; + void operator=(const random_device&) = delete; }; #endif // !_LIBCPP_HAS_NO_RANDOM_DEVICE diff --git a/libcxx/include/__random/seed_seq.h b/libcxx/include/__random/seed_seq.h index 97bc88d0d4d156..bf27af6627a541 100644 --- a/libcxx/include/__random/seed_seq.h +++ b/libcxx/include/__random/seed_seq.h @@ -63,10 +63,8 @@ class _LIBCPP_TEMPLATE_VIS seed_seq void param(_OutputIterator __dest) const {_VSTD::copy(__v_.begin(), __v_.end(), __dest);} -private: - // no copy functions - seed_seq(const seed_seq&); // = delete; - void operator=(const seed_seq&); // = delete; + seed_seq(const seed_seq&) = delete; + void operator=(const seed_seq&) = delete; _LIBCPP_INLINE_VISIBILITY static result_type _Tp(result_type __x) {return __x ^ (__x >> 27);} diff --git a/libcxx/include/ios b/libcxx/include/ios index b7d32946bff030..237d146dfb85c5 100644 --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -308,11 +308,9 @@ public: typedef void (*event_callback)(event, ios_base&, int __index); void register_callback(event_callback __fn, int __index); -private: - ios_base(const ios_base&); // = delete; - ios_base& operator=(const ios_base&); // = delete; + ios_base(const ios_base&) = delete; + ios_base& operator=(const ios_base&) = delete; -public: static bool sync_with_stdio(bool __sync = true); _LIBCPP_INLINE_VISIBILITY iostate rdstate() const; diff --git a/libcxx/include/istream b/libcxx/include/istream index 2f39e35f464649..de49d49e45645d 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -291,15 +291,15 @@ class _LIBCPP_TEMPLATE_VIS basic_istream<_CharT, _Traits>::sentry { bool __ok_; - sentry(const sentry&); // = delete; - sentry& operator=(const sentry&); // = delete; - public: explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false); // ~sentry() = default; _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __ok_;} + + sentry(const sentry&) = delete; + sentry& operator=(const sentry&) = delete; }; template diff --git a/libcxx/include/mutex b/libcxx/include/mutex index 822abe1a3f1709..b2a4d7993e0db8 100644 --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -215,14 +215,12 @@ class _LIBCPP_TYPE_VIS recursive_mutex __libcpp_recursive_mutex_t __m_; public: - recursive_mutex(); - ~recursive_mutex(); + recursive_mutex(); + ~recursive_mutex(); -private: - recursive_mutex(const recursive_mutex&); // = delete; - recursive_mutex& operator=(const recursive_mutex&); // = delete; + recursive_mutex(const recursive_mutex&) = delete; + recursive_mutex& operator=(const recursive_mutex&) = delete; -public: void lock(); bool try_lock() _NOEXCEPT; void unlock() _NOEXCEPT; @@ -242,9 +240,8 @@ public: timed_mutex(); ~timed_mutex(); -private: - timed_mutex(const timed_mutex&); // = delete; - timed_mutex& operator=(const timed_mutex&); // = delete; + timed_mutex(const timed_mutex&) = delete; + timed_mutex& operator=(const timed_mutex&) = delete; public: void lock(); @@ -283,14 +280,12 @@ class _LIBCPP_TYPE_VIS recursive_timed_mutex size_t __count_; __thread_id __id_; public: - recursive_timed_mutex(); - ~recursive_timed_mutex(); + recursive_timed_mutex(); + ~recursive_timed_mutex(); -private: - recursive_timed_mutex(const recursive_timed_mutex&); // = delete; - recursive_timed_mutex& operator=(const recursive_timed_mutex&); // = delete; + recursive_timed_mutex(const recursive_timed_mutex&) = delete; + recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete; -public: void lock(); bool try_lock() _NOEXCEPT; template @@ -576,6 +571,8 @@ struct _LIBCPP_TEMPLATE_VIS once_flag _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR once_flag() _NOEXCEPT : __state_(0) {} + once_flag(const once_flag&) = delete; + once_flag& operator=(const once_flag&) = delete; #if defined(_LIBCPP_ABI_MICROSOFT) typedef uintptr_t _State_type; @@ -583,11 +580,7 @@ struct _LIBCPP_TEMPLATE_VIS once_flag typedef unsigned long _State_type; #endif - private: - once_flag(const once_flag&); // = delete; - once_flag& operator=(const once_flag&); // = delete; - _State_type __state_; #ifndef _LIBCPP_CXX03_LANG diff --git a/libcxx/include/ostream b/libcxx/include/ostream index 98f36ea7acc102..d948d591c8f053 100644 --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -249,12 +249,11 @@ class _LIBCPP_TEMPLATE_VIS basic_ostream<_CharT, _Traits>::sentry bool __ok_; basic_ostream<_CharT, _Traits>& __os_; - sentry(const sentry&); // = delete; - sentry& operator=(const sentry&); // = delete; - public: explicit sentry(basic_ostream<_CharT, _Traits>& __os); ~sentry(); + sentry(const sentry&) = delete; + sentry& operator=(const sentry&) = delete; _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __ok_;} diff --git a/libcxx/include/system_error b/libcxx/include/system_error index 0bd2d2363882c4..059fa0e2d511bf 100644 --- a/libcxx/include/system_error +++ b/libcxx/include/system_error @@ -208,11 +208,9 @@ public: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT = default; #endif -private: - error_category(const error_category&);// = delete; - error_category& operator=(const error_category&);// = delete; + error_category(const error_category&) = delete; + error_category& operator=(const error_category&) = delete; -public: virtual const char* name() const _NOEXCEPT = 0; virtual error_condition default_error_condition(int __ev) const _NOEXCEPT; virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;