Index: include/__functional_03 =================================================================== --- include/__functional_03 +++ include/__functional_03 @@ -459,7 +459,7 @@ function(const function&); template function(_Fp, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY @@ -471,7 +471,7 @@ function(allocator_arg_t, const _Alloc&, const function&); template function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); function& operator=(const function&); function& operator=(nullptr_t); @@ -739,7 +739,7 @@ function(const function&); template function(_Fp, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY @@ -751,7 +751,7 @@ function(allocator_arg_t, const _Alloc&, const function&); template function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); function& operator=(const function&); function& operator=(nullptr_t); @@ -1019,7 +1019,7 @@ function(const function&); template function(_Fp, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY @@ -1031,7 +1031,7 @@ function(allocator_arg_t, const _Alloc&, const function&); template function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); function& operator=(const function&); function& operator=(nullptr_t); @@ -1298,7 +1298,7 @@ function(const function&); template function(_Fp, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY @@ -1310,7 +1310,7 @@ function(allocator_arg_t, const _Alloc&, const function&); template function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if::value>::type* = 0); + typename enable_if::value>::type* = nullptr); function& operator=(const function&); function& operator=(nullptr_t); Index: include/__functional_base =================================================================== --- include/__functional_base +++ include/__functional_base @@ -37,9 +37,9 @@ private: struct __two {char __lx; char __lxx;}; template static __two __test(...); - template static char __test(typename _Up::result_type* = 0); + template static char __test(typename _Up::result_type* = nullptr); public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; + static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; }; #if _LIBCPP_STD_VER > 11 @@ -574,9 +574,9 @@ private: struct __two {char __lx; char __lxx;}; template static __two __test(...); - template static char __test(typename _Up::allocator_type* = 0); + template static char __test(typename _Up::allocator_type* = nullptr); public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; + static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; }; template ::value> Index: include/__locale =================================================================== --- include/__locale +++ include/__locale @@ -604,7 +604,7 @@ public: typedef char char_type; - explicit ctype(const mask* __tab = 0, bool __del = false, size_t __refs = 0); + explicit ctype(const mask* __tab = nullptr, bool __del = false, size_t __refs = 0); _LIBCPP_INLINE_VISIBILITY bool is(mask __m, char_type __c) const Index: include/__sso_allocator =================================================================== --- include/__sso_allocator +++ include/__sso_allocator @@ -47,7 +47,7 @@ private: __sso_allocator& operator=(const __sso_allocator&); public: - _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator::const_pointer = 0) + _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator::const_pointer = nullptr) { if (!__allocated_ && __n <= _Np) { Index: include/__string =================================================================== --- include/__string +++ include/__string @@ -562,7 +562,7 @@ return __s; ++__s; } - return 0; + return nullptr; } inline @@ -681,7 +681,7 @@ return __s; ++__s; } - return 0; + return nullptr; } inline @@ -738,7 +738,7 @@ if (__pos >= __sz) return __npos; const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c); - if (__r == 0) + if (__r == nullptr) return __npos; return static_cast<_SizeT>(__r - __p); } @@ -767,7 +767,7 @@ // Find __f2 the first byte matching in __first1. __first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2); - if (__first1 == 0) + if (__first1 == nullptr) return __last1; // It is faster to compare from the first byte of __first1 even if we @@ -890,7 +890,7 @@ { const _CharT* __pe = __p + __sz; for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps) - if (_Traits::find(__s, __n, *__ps) == 0) + if (_Traits::find(__s, __n, *__ps) == nullptr) return static_cast<_SizeT>(__ps - __p); } return __npos; @@ -924,7 +924,7 @@ else __pos = __sz; for (const _CharT* __ps = __p + __pos; __ps != __p;) - if (_Traits::find(__s, __n, *--__ps) == 0) + if (_Traits::find(__s, __n, *--__ps) == nullptr) return static_cast<_SizeT>(__ps - __p); return __npos; } Index: include/__threading_support =================================================================== --- include/__threading_support +++ include/__threading_support @@ -318,13 +318,13 @@ // Thread bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) { - return *__t == 0; + return *__t == nullptr; } int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), void *__arg) { - return pthread_create(__t, 0, __func, __arg); + return pthread_create(__t, nullptr, __func, __arg); } __libcpp_thread_id __libcpp_thread_get_current_id() @@ -339,7 +339,7 @@ int __libcpp_thread_join(__libcpp_thread_t *__t) { - return pthread_join(*__t, 0); + return pthread_join(*__t, nullptr); } int __libcpp_thread_detach(__libcpp_thread_t *__t) Index: include/algorithm =================================================================== --- include/algorithm +++ include/algorithm @@ -3875,7 +3875,7 @@ unique_ptr __h(__first2, __d); value_type* __last2 = __first2; ::new(__last2) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); + __d.__incr((value_type*)nullptr); for (++__last2; ++__first1 != __last1; ++__last2) { value_type* __j2 = __last2; @@ -3883,7 +3883,7 @@ if (__comp(*__first1, *--__i2)) { ::new(__j2) value_type(_VSTD::move(*__i2)); - __d.__incr((value_type*)0); + __d.__incr((value_type*)nullptr); for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2) *__j2 = _VSTD::move(*__i2); *__j2 = _VSTD::move(*__first1); @@ -3891,7 +3891,7 @@ else { ::new(__j2) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); + __d.__incr((value_type*)nullptr); } } __h.release(); @@ -4432,14 +4432,14 @@ if (__len1 <= __len2) { value_type* __p = __buff; - for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), (void) ++__i, ++__p) + for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)nullptr), (void) ++__i, ++__p) ::new(__p) value_type(_VSTD::move(*__i)); __half_inplace_merge(__buff, __p, __middle, __last, __first, __comp); } else { value_type* __p = __buff; - for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__i, ++__p) + for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)nullptr), (void) ++__i, ++__p) ::new(__p) value_type(_VSTD::move(*__i)); typedef reverse_iterator<_BidirectionalIterator> _RBi; typedef reverse_iterator _Rv; @@ -4579,14 +4579,14 @@ { if (__first1 == __last1) { - for (; __first2 != __last2; ++__first2, ++__result, __d.__incr((value_type*)0)) + for (; __first2 != __last2; ++__first2, ++__result, __d.__incr((value_type*)nullptr)) ::new (__result) value_type(_VSTD::move(*__first2)); __h.release(); return; } if (__first2 == __last2) { - for (; __first1 != __last1; ++__first1, ++__result, __d.__incr((value_type*)0)) + for (; __first1 != __last1; ++__first1, ++__result, __d.__incr((value_type*)nullptr)) ::new (__result) value_type(_VSTD::move(*__first1)); __h.release(); return; @@ -4594,13 +4594,13 @@ if (__comp(*__first2, *__first1)) { ::new (__result) value_type(_VSTD::move(*__first2)); - __d.__incr((value_type*)0); + __d.__incr((value_type*)nullptr); ++__first2; } else { ::new (__result) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); + __d.__incr((value_type*)nullptr); ++__first1; } } @@ -4661,14 +4661,14 @@ if (__comp(*--__last1, *__first1)) { ::new(__first2) value_type(_VSTD::move(*__last1)); - __d.__incr((value_type*)0); + __d.__incr((value_type*)nullptr); ++__first2; ::new(__first2) value_type(_VSTD::move(*__first1)); } else { ::new(__first2) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); + __d.__incr((value_type*)nullptr); ++__first2; ::new(__first2) value_type(_VSTD::move(*__last1)); } @@ -4723,9 +4723,9 @@ __destruct_n __d(0); unique_ptr __h2(__buff, __d); __stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff); - __d.__set(__l2, (value_type*)0); + __d.__set(__l2, (value_type*)nullptr); __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2); - __d.__set(__len, (value_type*)0); + __d.__set(__len, (value_type*)nullptr); __merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp); // __merge<_Compare>(move_iterator(__buff), // move_iterator(__buff + __l2), Index: include/bitset =================================================================== --- include/bitset +++ include/bitset @@ -625,13 +625,13 @@ explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT - {return reference(0, 1);} + {return reference(nullptr, 1);} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT - {return const_reference(0, 1);} + {return const_reference(nullptr, 1);} _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT - {return iterator(0, 0);} + {return iterator(nullptr, 0);} _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT - {return const_iterator(0, 0);} + {return const_iterator(nullptr, 0);} _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {} _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {} Index: include/chrono =================================================================== --- include/chrono +++ include/chrono @@ -57,7 +57,7 @@ is_convertible::value && (treat_as_floating_point::value || !treat_as_floating_point::value && !treat_as_floating_point::value) - >::type* = 0); + >::type* = nullptr); // conversions template @@ -66,7 +66,7 @@ < treat_as_floating_point::value || ratio_divide::type::den == 1 - >::type* = 0); + >::type* = nullptr); // observer @@ -1046,7 +1046,7 @@ is_convertible<_Rep2, rep>::value && (treat_as_floating_point::value || !treat_as_floating_point<_Rep2>::value) - >::type* = 0) + >::type* = nullptr) : __rep_(__r) {} // conversions @@ -1059,7 +1059,7 @@ treat_as_floating_point::value || (__no_overflow<_Period2, period>::type::den == 1 && !treat_as_floating_point<_Rep2>::value)) - >::type* = 0) + >::type* = nullptr) : __rep_(_VSTD::chrono::duration_cast(__d).count()) {} // observer @@ -1345,7 +1345,7 @@ typename enable_if < is_convertible<_Duration2, duration>::value - >::type* = 0) + >::type* = nullptr) : __d_(t.time_since_epoch()) {} // observer Index: include/deque =================================================================== --- include/deque +++ include/deque @@ -190,7 +190,7 @@ copy(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, - typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0); + typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = nullptr); template @@ -212,7 +212,7 @@ copy_backward(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, - typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0); + typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = nullptr); template @@ -234,7 +234,7 @@ move(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, - typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0); + typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = nullptr); template @@ -256,7 +256,7 @@ move_backward(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, - typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0); + typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = nullptr); template @@ -312,7 +312,7 @@ template _LIBCPP_INLINE_VISIBILITY __deque_iterator(const __deque_iterator& __it, - typename enable_if::value>::type* = 0) _NOEXCEPT + typename enable_if::value>::type* = nullptr) _NOEXCEPT : __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {} _LIBCPP_INLINE_VISIBILITY reference operator*() const {return *__ptr_;} @@ -1070,7 +1070,7 @@ __deque_base<_Tp, _Allocator>::begin() _NOEXCEPT { __map_pointer __mp = __map_.begin() + __start_ / __block_size; - return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size); + return iterator(__mp, __map_.empty() ? nullptr : *__mp + __start_ % __block_size); } template @@ -1078,7 +1078,7 @@ __deque_base<_Tp, _Allocator>::begin() const _NOEXCEPT { __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __start_ / __block_size); - return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size); + return const_iterator(__mp, __map_.empty() ? nullptr : *__mp + __start_ % __block_size); } template @@ -1087,7 +1087,7 @@ { size_type __p = size() + __start_; __map_pointer __mp = __map_.begin() + __p / __block_size; - return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size); + return iterator(__mp, __map_.empty() ? nullptr : *__mp + __p % __block_size); } template @@ -1236,10 +1236,10 @@ deque(size_type __n, const value_type& __v, const allocator_type& __a); template deque(_InputIter __f, _InputIter __l, - typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0); + typename enable_if<__is_input_iterator<_InputIter>::value>::type* = nullptr); template deque(_InputIter __f, _InputIter __l, const allocator_type& __a, - typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0); + typename enable_if<__is_input_iterator<_InputIter>::value>::type* = nullptr); deque(const deque& __c); deque(const deque& __c, const allocator_type& __a); @@ -1268,10 +1268,10 @@ template void assign(_InputIter __f, _InputIter __l, typename enable_if<__is_input_iterator<_InputIter>::value && - !__is_random_access_iterator<_InputIter>::value>::type* = 0); + !__is_random_access_iterator<_InputIter>::value>::type* = nullptr); template void assign(_RAIter __f, _RAIter __l, - typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0); + typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = nullptr); void assign(size_type __n, const value_type& __v); _LIBCPP_INLINE_VISIBILITY @@ -1372,14 +1372,14 @@ template iterator insert(const_iterator __p, _InputIter __f, _InputIter __l, typename enable_if<__is_input_iterator<_InputIter>::value - &&!__is_forward_iterator<_InputIter>::value>::type* = 0); + &&!__is_forward_iterator<_InputIter>::value>::type* = nullptr); template iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l, typename enable_if<__is_forward_iterator<_ForwardIterator>::value - &&!__is_bidirectional_iterator<_ForwardIterator>::value>::type* = 0); + &&!__is_bidirectional_iterator<_ForwardIterator>::value>::type* = nullptr); template iterator insert(const_iterator __p, _BiIter __f, _BiIter __l, - typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = 0); + typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = nullptr); void pop_front(); void pop_back(); @@ -1426,10 +1426,10 @@ template void __append(_InpIter __f, _InpIter __l, typename enable_if<__is_input_iterator<_InpIter>::value && - !__is_forward_iterator<_InpIter>::value>::type* = 0); + !__is_forward_iterator<_InpIter>::value>::type* = nullptr); template void __append(_ForIter __f, _ForIter __l, - typename enable_if<__is_forward_iterator<_ForIter>::value>::type* = 0); + typename enable_if<__is_forward_iterator<_ForIter>::value>::type* = nullptr); void __append(size_type __n); void __append(size_type __n, const value_type& __v); void __erase_to_end(const_iterator __f); Index: include/exception =================================================================== --- include/exception +++ include/exception @@ -317,7 +317,7 @@ inline _LIBCPP_INLINE_VISIBILITY void rethrow_if_nested(const _Ep& __e, - typename enable_if< __can_dynamic_cast<_Ep, nested_exception>::value>::type* = 0) + typename enable_if< __can_dynamic_cast<_Ep, nested_exception>::value>::type* = nullptr) { const nested_exception* __nep = dynamic_cast(_VSTD::addressof(__e)); if (__nep) @@ -328,7 +328,7 @@ inline _LIBCPP_INLINE_VISIBILITY void rethrow_if_nested(const _Ep&, - typename enable_if::value>::type* = 0) + typename enable_if::value>::type* = nullptr) { } Index: include/fstream =================================================================== --- include/fstream +++ include/fstream @@ -286,13 +286,13 @@ template basic_filebuf<_CharT, _Traits>::basic_filebuf() - : __extbuf_(0), - __extbufnext_(0), - __extbufend_(0), + : __extbuf_(nullptr), + __extbufnext_(nullptr), + __extbufend_(nullptr), __ebs_(0), - __intbuf_(0), + __intbuf_(nullptr), __ibs_(0), - __file_(0), + __file_(nullptr), __cv_(nullptr), __st_(), __st_last_(), @@ -307,7 +307,7 @@ __cv_ = &use_facet >(this->getloc()); __always_noconv_ = __cv_->always_noconv(); } - setbuf(0, 4096); + setbuf(nullptr, 4096); } #ifndef _LIBCPP_CXX03_LANG @@ -359,13 +359,13 @@ (char_type*)__extbuf_ + (__rhs.gptr() - __rhs.eback()), (char_type*)__extbuf_ + (__rhs.egptr() - __rhs.eback())); } - __rhs.__extbuf_ = 0; - __rhs.__extbufnext_ = 0; - __rhs.__extbufend_ = 0; + __rhs.__extbuf_ = nullptr; + __rhs.__extbufnext_ = nullptr; + __rhs.__extbufend_ = nullptr; __rhs.__ebs_ = 0; __rhs.__intbuf_ = 0; __rhs.__ibs_ = 0; - __rhs.__file_ = 0; + __rhs.__file_ = nullptr; __rhs.__st_ = state_type(); __rhs.__st_last_ = state_type(); __rhs.__om_ = 0; @@ -499,7 +499,7 @@ bool basic_filebuf<_CharT, _Traits>::is_open() const { - return __file_ != 0; + return __file_ != nullptr; } template @@ -547,8 +547,8 @@ basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode) { - basic_filebuf<_CharT, _Traits>* __rt = 0; - if (__file_ == 0) + basic_filebuf<_CharT, _Traits>* __rt = nullptr; + if (__file_ == nullptr) { if (const char* __mdstr = __make_mdstring(__mode)) { __rt = this; @@ -558,12 +558,12 @@ if (__mode & ios_base::ate) { if (fseek(__file_, 0, SEEK_END)) { fclose(__file_); - __file_ = 0; - __rt = 0; + __file_ = nullptr; + __rt = nullptr; } } } else - __rt = 0; + __rt = nullptr; } } return __rt; @@ -572,8 +572,8 @@ template _LIBCPP_INLINE_VISIBILITY basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::__open(int __fd, ios_base::openmode __mode) { - basic_filebuf<_CharT, _Traits>* __rt = 0; - if (__file_ == 0) { + basic_filebuf<_CharT, _Traits>* __rt = nullptr; + if (__file_ == nullptr) { if (const char* __mdstr = __make_mdstring(__mode)) { __rt = this; __file_ = fdopen(__fd, __mdstr); @@ -582,12 +582,12 @@ if (__mode & ios_base::ate) { if (fseek(__file_, 0, SEEK_END)) { fclose(__file_); - __file_ = 0; - __rt = 0; + __file_ = nullptr; + __rt = nullptr; } } } else - __rt = 0; + __rt = nullptr; } } return __rt; @@ -600,8 +600,8 @@ basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) { - basic_filebuf<_CharT, _Traits>* __rt = 0; - if (__file_ == 0) + basic_filebuf<_CharT, _Traits>* __rt = nullptr; + if (__file_ == nullptr) { __rt = this; const wchar_t* __mdstr; @@ -650,7 +650,7 @@ __mdstr = L"a+b"; break; default: - __rt = 0; + __rt = nullptr; break; } if (__rt) @@ -664,13 +664,13 @@ if (fseek(__file_, 0, SEEK_END)) { fclose(__file_); - __file_ = 0; - __rt = 0; + __file_ = nullptr; + __rt = nullptr; } } } else - __rt = 0; + __rt = nullptr; } } return __rt; @@ -690,18 +690,18 @@ basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::close() { - basic_filebuf<_CharT, _Traits>* __rt = 0; + basic_filebuf<_CharT, _Traits>* __rt = nullptr; if (__file_) { __rt = this; unique_ptr __h(__file_, fclose); if (sync()) - __rt = 0; + __rt = nullptr; if (fclose(__h.release()) == 0) - __file_ = 0; + __file_ = nullptr; else - __rt = 0; - setbuf(0, 0); + __rt = nullptr; + setbuf(nullptr, 0); } return __rt; } @@ -710,11 +710,11 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::underflow() { - if (__file_ == 0) + if (__file_ == nullptr) return traits_type::eof(); bool __initial = __read_mode(); char_type __1buf; - if (this->gptr() == 0) + if (this->gptr() == nullptr) this->setg(&__1buf, &__1buf+1, &__1buf+1); const size_t __unget_sz = __initial ? 0 : min((this->egptr() - this->eback()) / 2, 4); int_type __c = traits_type::eof(); @@ -772,7 +772,7 @@ else __c = traits_type::to_int_type(*this->gptr()); if (this->eback() == &__1buf) - this->setg(0, 0, 0); + this->setg(nullptr, nullptr, nullptr); return __c; } @@ -802,7 +802,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::overflow(int_type __c) { - if (__file_ == 0) + if (__file_ == nullptr) return traits_type::eof(); __write_mode(); char_type __1buf; @@ -810,7 +810,7 @@ char_type* __epb_save = this->epptr(); if (!traits_type::eq_int_type(__c, traits_type::eof())) { - if (this->pptr() == 0) + if (this->pptr() == nullptr) this->setp(&__1buf, &__1buf+1); *this->pptr() = traits_type::to_char_type(__c); this->pbump(1); @@ -867,8 +867,8 @@ basic_streambuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n) { - this->setg(0, 0, 0); - this->setp(0, 0); + this->setg(nullptr, nullptr, nullptr); + this->setp(nullptr, nullptr); if (__owns_eb_) delete [] __extbuf_; if (__owns_ib_) @@ -910,7 +910,7 @@ else { __ibs_ = 0; - __intbuf_ = 0; + __intbuf_ = nullptr; __owns_ib_ = false; } return this; @@ -925,7 +925,7 @@ __throw_bad_cast(); int __width = __cv_->encoding(); - if (__file_ == 0 || (__width <= 0 && __off != 0) || sync()) + if (__file_ == nullptr || (__width <= 0 && __off != 0) || sync()) return pos_type(off_type(-1)); // __width > 0 || __off == 0 int __whence; @@ -960,7 +960,7 @@ typename basic_filebuf<_CharT, _Traits>::pos_type basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode) { - if (__file_ == 0 || sync()) + if (__file_ == nullptr || sync()) return pos_type(off_type(-1)); #if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS) if (fseek(__file_, __sp, SEEK_SET)) @@ -977,7 +977,7 @@ int basic_filebuf<_CharT, _Traits>::sync() { - if (__file_ == 0) + if (__file_ == nullptr) return 0; if (!__cv_) __throw_bad_cast(); @@ -1036,7 +1036,7 @@ if (__update_st) __st_ = __state; __extbufnext_ = __extbufend_ = __extbuf_; - this->setg(0, 0, 0); + this->setg(nullptr, nullptr, nullptr); __cm_ = 0; } return 0; @@ -1052,8 +1052,8 @@ __always_noconv_ = __cv_->always_noconv(); if (__old_anc != __always_noconv_) { - this->setg(0, 0, 0); - this->setp(0, 0); + this->setg(nullptr, nullptr, nullptr); + this->setp(nullptr, nullptr); // invariant, char_type is char, else we couldn't get here if (__always_noconv_) // need to dump __intbuf_ { @@ -1063,7 +1063,7 @@ __ebs_ = __ibs_; __extbuf_ = (char*)__intbuf_; __ibs_ = 0; - __intbuf_ = 0; + __intbuf_ = nullptr; __owns_ib_ = false; } else // need to obtain an __intbuf_. @@ -1092,7 +1092,7 @@ { if (!(__cm_ & ios_base::in)) { - this->setp(0, 0); + this->setp(nullptr, nullptr); if (__always_noconv_) this->setg((char_type*)__extbuf_, (char_type*)__extbuf_ + __ebs_, @@ -1111,7 +1111,7 @@ { if (!(__cm_ & ios_base::out)) { - this->setg(0, 0, 0); + this->setg(nullptr, nullptr, nullptr); if (__ebs_ > sizeof(__extbuf_min_)) { if (__always_noconv_) @@ -1121,7 +1121,7 @@ this->setp(__intbuf_, __intbuf_ + (__ibs_ - 1)); } else - this->setp(0, 0); + this->setp(nullptr, nullptr); __cm_ = ios_base::out; } } @@ -1207,7 +1207,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode) : basic_istream(&__sb_) { - if (__sb_.open(__s, __mode | ios_base::in) == 0) + if (__sb_.open(__s, __mode | ios_base::in) == nullptr) this->setstate(ios_base::failbit); } @@ -1217,7 +1217,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode) : basic_istream(&__sb_) { - if (__sb_.open(__s, __mode | ios_base::in) == 0) + if (__sb_.open(__s, __mode | ios_base::in) == nullptr) this->setstate(ios_base::failbit); } #endif @@ -1227,7 +1227,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode) : basic_istream(&__sb_) { - if (__sb_.open(__s, __mode | ios_base::in) == 0) + if (__sb_.open(__s, __mode | ios_base::in) == nullptr) this->setstate(ios_base::failbit); } #endif @@ -1420,7 +1420,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode) : basic_ostream(&__sb_) { - if (__sb_.open(__s, __mode | ios_base::out) == 0) + if (__sb_.open(__s, __mode | ios_base::out) == nullptr) this->setstate(ios_base::failbit); } @@ -1430,7 +1430,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode) : basic_ostream(&__sb_) { - if (__sb_.open(__s, __mode | ios_base::out) == 0) + if (__sb_.open(__s, __mode | ios_base::out) == nullptr) this->setstate(ios_base::failbit); } #endif @@ -1440,7 +1440,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode) : basic_ostream(&__sb_) { - if (__sb_.open(__s, __mode | ios_base::out) == 0) + if (__sb_.open(__s, __mode | ios_base::out) == nullptr) this->setstate(ios_base::failbit); } #endif @@ -1549,7 +1549,7 @@ void basic_ofstream<_CharT, _Traits>::close() { - if (__sb_.close() == 0) + if (__sb_.close() == nullptr) this->setstate(ios_base::failbit); } @@ -1633,7 +1633,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode) : basic_iostream(&__sb_) { - if (__sb_.open(__s, __mode) == 0) + if (__sb_.open(__s, __mode) == nullptr) this->setstate(ios_base::failbit); } @@ -1643,7 +1643,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode) : basic_iostream(&__sb_) { - if (__sb_.open(__s, __mode) == 0) + if (__sb_.open(__s, __mode) == nullptr) this->setstate(ios_base::failbit); } #endif @@ -1653,7 +1653,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode) : basic_iostream(&__sb_) { - if (__sb_.open(__s, __mode) == 0) + if (__sb_.open(__s, __mode) == nullptr) this->setstate(ios_base::failbit); } #endif @@ -1753,7 +1753,7 @@ void basic_fstream<_CharT, _Traits>::close() { - if (__sb_.close() == 0) + if (__sb_.close() == nullptr) this->setstate(ios_base::failbit); } Index: include/functional =================================================================== --- include/functional +++ include/functional @@ -1663,7 +1663,7 @@ { if (__ti == typeid(_Fp)) return &__f_.__target(); - return (const void*)0; + return nullptr; } template Index: include/ios =================================================================== --- include/ios +++ include/ios @@ -709,7 +709,7 @@ basic_ios<_CharT, _Traits>::init(basic_streambuf* __sb) { ios_base::init(__sb); - __tie_ = 0; + __tie_ = nullptr; __fill_ = traits_type::eof(); } @@ -820,7 +820,7 @@ { ios_base::move(__rhs); __tie_ = __rhs.__tie_; - __rhs.__tie_ = 0; + __rhs.__tie_ = nullptr; __fill_ = __rhs.__fill_; } Index: include/istream =================================================================== --- include/istream +++ include/istream @@ -1142,7 +1142,7 @@ try { #endif // _LIBCPP_NO_EXCEPTIONS - if (this->rdbuf() == 0 || this->rdbuf()->sputbackc(__c) == traits_type::eof()) + if (this->rdbuf() == nullptr || this->rdbuf()->sputbackc(__c) == traits_type::eof()) __state |= ios_base::badbit; #ifndef _LIBCPP_NO_EXCEPTIONS } @@ -1179,7 +1179,7 @@ try { #endif // _LIBCPP_NO_EXCEPTIONS - if (this->rdbuf() == 0 || this->rdbuf()->sungetc() == traits_type::eof()) + if (this->rdbuf() == nullptr || this->rdbuf()->sungetc() == traits_type::eof()) __state |= ios_base::badbit; #ifndef _LIBCPP_NO_EXCEPTIONS } @@ -1215,7 +1215,7 @@ try { #endif // _LIBCPP_NO_EXCEPTIONS - if (this->rdbuf() == 0) + if (this->rdbuf() == nullptr) return -1; if (this->rdbuf()->pubsync() == -1) { Index: include/iterator =================================================================== --- include/iterator +++ include/iterator @@ -447,14 +447,14 @@ private: struct __two {char __lx; char __lxx;}; template static __two __test(...); - template static char __test(typename std::__void_t::type* = 0, - typename std::__void_t::type* = 0, - typename std::__void_t::type* = 0, - typename std::__void_t::type* = 0, - typename std::__void_t::type* = 0 + template static char __test(typename std::__void_t::type* = nullptr, + typename std::__void_t::type* = nullptr, + typename std::__void_t::type* = nullptr, + typename std::__void_t::type* = nullptr, + typename std::__void_t::type* = nullptr ); public: - static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1; + static const bool value = sizeof(__test<_Tp>(nullptr,nullptr,nullptr,nullptr,nullptr)) == 1; }; @@ -464,9 +464,9 @@ private: struct __two {char __lx; char __lxx;}; template static __two __test(...); - template static char __test(typename _Up::iterator_category* = 0); + template static char __test(typename _Up::iterator_category* = nullptr); public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; + static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; }; template struct __iterator_traits_impl {}; @@ -915,11 +915,11 @@ istream_type* __in_stream_; _Tp __value_; public: - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {} _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s)) { if (!(*__in_stream_ >> __value_)) - __in_stream_ = 0; + __in_stream_ = nullptr; } _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;} @@ -927,7 +927,7 @@ _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++() { if (!(*__in_stream_ >> __value_)) - __in_stream_ = 0; + __in_stream_ = nullptr; return *this; } _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int) @@ -977,7 +977,7 @@ const char_type* __delim_; public: _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT - : __out_stream_(_VSTD::addressof(__s)), __delim_(0) {} + : __out_stream_(_VSTD::addressof(__s)), __delim_(nullptr) {} _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {} _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_) @@ -1023,11 +1023,11 @@ bool __test_for_eof() const { if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof())) - __sbuf_ = 0; - return __sbuf_ == 0; + __sbuf_ = nullptr; + return __sbuf_ == nullptr; } public: - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT : __sbuf_(__s.rdbuf()) {} _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT @@ -1082,13 +1082,13 @@ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c) { if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof())) - __sbuf_ = 0; + __sbuf_ = nullptr; return *this; } _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;} _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;} _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;} - _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;} + _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == nullptr;} template friend @@ -1341,7 +1341,7 @@ } template _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(const __wrap_iter<_Up>& __u, - typename enable_if::value>::type* = 0) _NOEXCEPT + typename enable_if::value>::type* = nullptr) _NOEXCEPT : __i(__u.base()) { #if _LIBCPP_DEBUG_LEVEL >= 2 Index: include/list =================================================================== --- include/list +++ include/list @@ -881,10 +881,10 @@ list(size_type __n, const value_type& __x, const allocator_type& __a); template list(_InpIter __f, _InpIter __l, - typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0); + typename enable_if<__is_input_iterator<_InpIter>::value>::type* = nullptr); template list(_InpIter __f, _InpIter __l, const allocator_type& __a, - typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0); + typename enable_if<__is_input_iterator<_InpIter>::value>::type* = nullptr); list(const list& __c); list(const list& __c, const allocator_type& __a); @@ -916,7 +916,7 @@ template void assign(_InpIter __f, _InpIter __l, - typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0); + typename enable_if<__is_input_iterator<_InpIter>::value>::type* = nullptr); void assign(size_type __n, const value_type& __x); _LIBCPP_INLINE_VISIBILITY @@ -1033,7 +1033,7 @@ iterator insert(const_iterator __p, size_type __n, const value_type& __x); template iterator insert(const_iterator __p, _InpIter __f, _InpIter __l, - typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0); + typename enable_if<__is_input_iterator<_InpIter>::value>::type* = nullptr); _LIBCPP_INLINE_VISIBILITY void swap(list& __c) Index: include/locale =================================================================== --- include/locale +++ include/locale @@ -218,7 +218,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if defined(__APPLE__) || defined(__FreeBSD__) -# define _LIBCPP_GET_C_LOCALE 0 +# define _LIBCPP_GET_C_LOCALE nullptr #elif defined(__CloudABI__) || defined(__NetBSD__) # define _LIBCPP_GET_C_LOCALE LC_C_LOCALE #else @@ -261,11 +261,11 @@ const unsigned char __does_match = '\2'; unsigned char __statbuf[100]; unsigned char* __status = __statbuf; - unique_ptr __stat_hold(0, free); + unique_ptr __stat_hold(nullptr, free); if (__nkw > sizeof(__statbuf)) { __status = (unsigned char*)malloc(__nkw); - if (__status == 0) + if (__status == nullptr) __throw_bad_alloc(); __stat_hold.reset(__status); } @@ -1564,14 +1564,14 @@ (int)__iob.precision(), __v); else __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v); - unique_ptr __nbh(0, free); + unique_ptr __nbh(nullptr, free); if (__nc > static_cast(__nbuf-1)) { if (__specify_precision) __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); else __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v); - if (__nb == 0) + if (__nb == nullptr) __throw_bad_alloc(); __nbh.reset(__nb); } @@ -1580,11 +1580,11 @@ // Stage 2 - Widen __nar while adding thousands separators char_type __o[2*(__nbuf-1) - 1]; char_type* __ob = __o; - unique_ptr __obh(0, free); + unique_ptr __obh(nullptr, free); if (__nb != __nar) { __ob = (char_type*)malloc(2*static_cast(__nc)*sizeof(char_type)); - if (__ob == 0) + if (__ob == nullptr) __throw_bad_alloc(); __obh.reset(__ob); } @@ -1615,14 +1615,14 @@ (int)__iob.precision(), __v); else __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v); - unique_ptr __nbh(0, free); + unique_ptr __nbh(nullptr, free); if (__nc > static_cast(__nbuf-1)) { if (__specify_precision) __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); else __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v); - if (__nb == 0) + if (__nb == nullptr) __throw_bad_alloc(); __nbh.reset(__nb); } @@ -1631,11 +1631,11 @@ // Stage 2 - Widen __nar while adding thousands separators char_type __o[2*(__nbuf-1) - 1]; char_type* __ob = __o; - unique_ptr __obh(0, free); + unique_ptr __obh(nullptr, free); if (__nb != __nar) { __ob = (char_type*)malloc(2*static_cast(__nc)*sizeof(char_type)); - if (__ob == 0) + if (__ob == nullptr) __throw_bad_alloc(); __obh.reset(__ob); } @@ -2851,8 +2851,8 @@ if (__new_cap == 0) __new_cap = sizeof(_Tp); size_t __n_off = static_cast(__n - __b.get()); - _Tp* __t = (_Tp*)realloc(__owns ? __b.get() : 0, __new_cap); - if (__t == 0) + _Tp* __t = (_Tp*)realloc(__owns ? __b.get() : nullptr, __new_cap); + if (__t == nullptr) __throw_bad_alloc(); if (__owns) __b.release(); @@ -2892,7 +2892,7 @@ int __fd; __money_get<_CharT>::__gather_info(__intl, __loc, __pat, __dp, __ts, __grp, __sym, __psn, __nsn, __fd); - const string_type* __trailing_sign = 0; + const string_type* __trailing_sign = nullptr; __wn = __wb.get(); for (unsigned __p = 0; __p < 4 && __b != __e; ++__p) { @@ -3108,11 +3108,11 @@ __ct.widen(__src, __src + (sizeof(__src)-1), __atoms); char __nbuf[__bz]; char* __nc = __nbuf; - unique_ptr __h(0, free); + unique_ptr __h(nullptr, free); if (__wn - __wb.get() > __bz-2) { __h.reset((char*)malloc(static_cast(__wn - __wb.get() + 2))); - if (__h.get() == 0) + if (__h.get() == nullptr) __throw_bad_alloc(); __nc = __h.get(); } @@ -3397,13 +3397,13 @@ char_type __digits[__bs]; char_type* __db = __digits; size_t __n = static_cast(snprintf(__bb, __bs, "%.0Lf", __units)); - unique_ptr __hn(0, free); - unique_ptr __hd(0, free); + unique_ptr __hn(nullptr, free); + unique_ptr __hd(nullptr, free); // secure memory for digit storage if (__n > __bs-1) { __n = static_cast(__libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units)); - if (__bb == 0) + if (__bb == nullptr) __throw_bad_alloc(); __hn.reset(__bb); __hd.reset((char_type*)malloc(__n * sizeof(char_type))); @@ -3427,7 +3427,7 @@ // secure memory for formatting char_type __mbuf[__bs]; char_type* __mb = __mbuf; - unique_ptr __hw(0, free); + unique_ptr __hw(nullptr, free); size_t __exn = static_cast(__n) > __fd ? (__n - static_cast(__fd)) * 2 + __sn.size() + __sym.size() + static_cast(__fd) + 1 @@ -3436,7 +3436,7 @@ { __hw.reset((char_type*)malloc(__exn * sizeof(char_type))); __mb = __hw.get(); - if (__mb == 0) + if (__mb == nullptr) __throw_bad_alloc(); } // format @@ -3469,7 +3469,7 @@ // secure memory for formatting char_type __mbuf[100]; char_type* __mb = __mbuf; - unique_ptr __h(0, free); + unique_ptr __h(nullptr, free); size_t __exn = static_cast(__digits.size()) > __fd ? (__digits.size() - static_cast(__fd)) * 2 + __sn.size() + __sym.size() + static_cast(__fd) + 1 @@ -3478,7 +3478,7 @@ { __h.reset((char_type*)malloc(__exn * sizeof(char_type))); __mb = __h.get(); - if (__mb == 0) + if (__mb == nullptr) __throw_bad_alloc(); } // format @@ -3923,7 +3923,7 @@ wbuffer_convert(const wbuffer_convert&); wbuffer_convert& operator=(const wbuffer_convert&); public: - _LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = 0, + _LIBCPP_EXPLICIT_AFTER_CXX11 wbuffer_convert(streambuf* __bytebuf = nullptr, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); ~wbuffer_convert(); @@ -3961,9 +3961,9 @@ template wbuffer_convert<_Codecvt, _Elem, _Tr>:: wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt, state_type __state) - : __extbuf_(0), - __extbufnext_(0), - __extbufend_(0), + : __extbuf_(nullptr), + __extbufnext_(nullptr), + __extbufend_(nullptr), __ebs_(0), __intbuf_(0), __ibs_(0), Index: include/memory =================================================================== --- include/memory +++ include/memory @@ -839,9 +839,9 @@ private: struct __two {char __lx; char __lxx;}; template static __two __test(...); - template static char __test(typename _Xp::template rebind<_Up>* = 0); + template static char __test(typename _Xp::template rebind<_Up>* = nullptr); public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; + static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; }; template ::value> @@ -1256,9 +1256,9 @@ private: struct __two {char __lx; char __lxx;}; template static __two __test(...); - template static char __test(typename _Xp::template rebind<_Up>::other* = 0); + template static char __test(typename _Xp::template rebind<_Up>::other* = nullptr); public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; + static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; }; template @@ -1805,7 +1805,7 @@ _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT {return _VSTD::addressof(__x);} _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - pointer allocate(size_type __n, allocator::const_pointer = 0) + pointer allocate(size_type __n, allocator::const_pointer = nullptr) { if (__n > max_size()) __throw_length_error("allocator::allocate(size_t n)" @@ -1906,7 +1906,7 @@ _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT {return _VSTD::addressof(__x);} - _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator::const_pointer = 0) + _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator::const_pointer = nullptr) { if (__n > max_size()) __throw_length_error("allocator::allocate(size_t n)" @@ -2102,7 +2102,7 @@ _LIBCPP_INLINE_VISIBILITY _Tp* release() throw() { _Tp* __t = __ptr_; - __ptr_ = 0; + __ptr_ = nullptr; return __t; } _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) throw() @@ -2356,7 +2356,7 @@ template _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up[]>&, - typename _EnableIfConvertible<_Up>::type* = 0) _NOEXCEPT {} + typename _EnableIfConvertible<_Up>::type* = nullptr) _NOEXCEPT {} template _LIBCPP_INLINE_VISIBILITY @@ -4043,8 +4043,8 @@ inline _LIBCPP_CONSTEXPR shared_ptr<_Tp>::shared_ptr() _NOEXCEPT - : __ptr_(0), - __cntrl_(0) + : __ptr_(nullptr), + __cntrl_(nullptr) { } @@ -4052,8 +4052,8 @@ inline _LIBCPP_CONSTEXPR shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT - : __ptr_(0), - __cntrl_(0) + : __ptr_(nullptr), + __cntrl_(nullptr) { } @@ -4098,7 +4098,7 @@ template template shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d) - : __ptr_(0) + : __ptr_(nullptr) { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -4149,7 +4149,7 @@ template template shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a) - : __ptr_(0) + : __ptr_(nullptr) { #ifndef _LIBCPP_NO_EXCEPTIONS try @@ -4215,8 +4215,8 @@ : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) { - __r.__ptr_ = 0; - __r.__cntrl_ = 0; + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; } template @@ -4228,8 +4228,8 @@ : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) { - __r.__ptr_ = 0; - __r.__cntrl_ = 0; + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -5090,8 +5090,8 @@ inline _LIBCPP_CONSTEXPR weak_ptr<_Tp>::weak_ptr() _NOEXCEPT - : __ptr_(0), - __cntrl_(0) + : __ptr_(nullptr), + __cntrl_(nullptr) { } @@ -5139,8 +5139,8 @@ : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) { - __r.__ptr_ = 0; - __r.__cntrl_ = 0; + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; } template @@ -5152,8 +5152,8 @@ : __ptr_(__r.__ptr_), __cntrl_(__r.__cntrl_) { - __r.__ptr_ = 0; - __r.__cntrl_ = 0; + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; } #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES Index: include/queue =================================================================== --- include/queue +++ include/queue @@ -257,32 +257,32 @@ _LIBCPP_INLINE_VISIBILITY explicit queue(const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(__a) {} template _LIBCPP_INLINE_VISIBILITY queue(const queue& __q, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(__q.c, __a) {} template _LIBCPP_INLINE_VISIBILITY queue(const container_type& __c, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(__c, __a) {} #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY queue(container_type&& __c, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(_VSTD::move(__c), __a) {} template _LIBCPP_INLINE_VISIBILITY queue(queue&& __q, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(_VSTD::move(__q.c), __a) {} #endif // _LIBCPP_CXX03_LANG @@ -494,35 +494,35 @@ _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const _Alloc& __a, typename enable_if::value>::type* = 0); + _Alloc>::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const _Alloc& __a, typename enable_if::value>::type* = 0); + _Alloc>::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const container_type& __c, const _Alloc& __a, typename enable_if::value>::type* = 0); + _Alloc>::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY priority_queue(const priority_queue& __q, const _Alloc& __a, typename enable_if::value>::type* = 0); + _Alloc>::value>::type* = nullptr); #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, container_type&& __c, const _Alloc& __a, typename enable_if::value>::type* = 0); + _Alloc>::value>::type* = nullptr); template _LIBCPP_INLINE_VISIBILITY priority_queue(priority_queue&& __q, const _Alloc& __a, typename enable_if::value>::type* = 0); + _Alloc>::value>::type* = nullptr); #endif // _LIBCPP_CXX03_LANG _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY Index: include/random =================================================================== --- include/random +++ include/random @@ -1865,7 +1865,7 @@ template _LIBCPP_INLINE_VISIBILITY explicit linear_congruential_engine(_Sseq& __q, - typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = 0) + typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = nullptr) {seed(__q);} _LIBCPP_INLINE_VISIBILITY void seed(result_type __s = default_seed) @@ -2112,7 +2112,7 @@ template _LIBCPP_INLINE_VISIBILITY explicit mersenne_twister_engine(_Sseq& __q, - typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0) + typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = nullptr) {seed(__q);} void seed(result_type __sd = default_seed); template @@ -2568,7 +2568,7 @@ template _LIBCPP_INLINE_VISIBILITY explicit subtract_with_carry_engine(_Sseq& __q, - typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = 0) + typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = nullptr) {seed(__q);} _LIBCPP_INLINE_VISIBILITY void seed(result_type __sd = default_seed) @@ -2858,7 +2858,7 @@ _LIBCPP_INLINE_VISIBILITY explicit discard_block_engine(_Sseq& __q, typename enable_if<__is_seed_sequence<_Sseq, discard_block_engine>::value && - !is_convertible<_Sseq, _Engine>::value>::type* = 0) + !is_convertible<_Sseq, _Engine>::value>::type* = nullptr) : __e_(__q), __n_(0) {} _LIBCPP_INLINE_VISIBILITY void seed() {__e_.seed(); __n_ = 0;} @@ -3068,7 +3068,7 @@ _LIBCPP_INLINE_VISIBILITY explicit independent_bits_engine(_Sseq& __q, typename enable_if<__is_seed_sequence<_Sseq, independent_bits_engine>::value && - !is_convertible<_Sseq, _Engine>::value>::type* = 0) + !is_convertible<_Sseq, _Engine>::value>::type* = nullptr) : __e_(__q) {} _LIBCPP_INLINE_VISIBILITY void seed() {__e_.seed();} @@ -3298,7 +3298,7 @@ _LIBCPP_INLINE_VISIBILITY explicit shuffle_order_engine(_Sseq& __q, typename enable_if<__is_seed_sequence<_Sseq, shuffle_order_engine>::value && - !is_convertible<_Sseq, _Engine>::value>::type* = 0) + !is_convertible<_Sseq, _Engine>::value>::type* = nullptr) : __e_(__q) {__init();} _LIBCPP_INLINE_VISIBILITY void seed() {__e_.seed(); __init();} Index: include/regex =================================================================== --- include/regex +++ include/regex @@ -2541,12 +2541,12 @@ _LIBCPP_INLINE_VISIBILITY basic_regex() : __flags_(regex_constants::ECMAScript), __marked_count_(0), __loop_count_(0), __open_count_(0), - __end_(0) + __end_(nullptr) {} _LIBCPP_INLINE_VISIBILITY explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript) : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), - __end_(0) + __end_(nullptr) { if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; __parse(__p, __p + __traits_.length(__p)); @@ -2555,7 +2555,7 @@ _LIBCPP_INLINE_VISIBILITY basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript) : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), - __end_(0) + __end_(nullptr) { if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; __parse(__p, __p + __len); @@ -2568,7 +2568,7 @@ explicit basic_regex(const basic_string& __p, flag_type __f = regex_constants::ECMAScript) : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), - __end_(0) + __end_(nullptr) { if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; __parse(__p.begin(), __p.end()); @@ -2579,7 +2579,7 @@ basic_regex(_ForwardIterator __first, _ForwardIterator __last, flag_type __f = regex_constants::ECMAScript) : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), - __end_(0) + __end_(nullptr) { if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; __parse(__first, __last); @@ -2589,7 +2589,7 @@ basic_regex(initializer_list __il, flag_type __f = regex_constants::ECMAScript) : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), - __end_(0) + __end_(nullptr) { if (__get_grammar(__flags_) == 0) __flags_ |= regex_constants::ECMAScript; __parse(__il.begin(), __il.end()); Index: include/sstream =================================================================== --- include/sstream +++ include/sstream @@ -239,7 +239,7 @@ template basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch) - : __hm_(0), + : __hm_(nullptr), __mode_(__wch) { } @@ -248,7 +248,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s, ios_base::openmode __wch) : __str_(__s.get_allocator()), - __hm_(0), + __hm_(nullptr), __mode_(__wch) { str(__s); @@ -453,7 +453,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s) { __str_ = __s; - __hm_ = 0; + __hm_ = nullptr; if (__mode_ & ios_base::in) { __hm_ = const_cast(__str_.data()) + __str_.size(); @@ -600,9 +600,9 @@ return pos_type(-1); if (__noff != 0) { - if ((__wch & ios_base::in) && this->gptr() == 0) + if ((__wch & ios_base::in) && this->gptr() == nullptr) return pos_type(-1); - if ((__wch & ios_base::out) && this->pptr() == 0) + if ((__wch & ios_base::out) && this->pptr() == nullptr) return pos_type(-1); } if (__wch & ios_base::in) Index: include/stack =================================================================== --- include/stack +++ include/stack @@ -157,32 +157,32 @@ _LIBCPP_INLINE_VISIBILITY explicit stack(const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(__a) {} template _LIBCPP_INLINE_VISIBILITY stack(const container_type& __c, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(__c, __a) {} template _LIBCPP_INLINE_VISIBILITY stack(const stack& __s, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(__s.c, __a) {} #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY stack(container_type&& __c, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(_VSTD::move(__c), __a) {} template _LIBCPP_INLINE_VISIBILITY stack(stack&& __s, const _Alloc& __a, typename enable_if::value>::type* = 0) + _Alloc>::value>::type* = nullptr) : c(_VSTD::move(__s.c), __a) {} #endif // _LIBCPP_CXX03_LANG Index: include/streambuf =================================================================== --- include/streambuf +++ include/streambuf @@ -308,12 +308,12 @@ template basic_streambuf<_CharT, _Traits>::basic_streambuf() - : __binp_(0), - __ninp_(0), - __einp_(0), - __bout_(0), - __nout_(0), - __eout_(0) + : __binp_(nullptr), + __ninp_(nullptr), + __einp_(nullptr), + __bout_(nullptr), + __nout_(nullptr), + __eout_(nullptr) { } Index: include/string =================================================================== --- include/string +++ include/string @@ -446,15 +446,15 @@ typedef basic_string u16string; typedef basic_string u32string; -int stoi (const string& str, size_t* idx = 0, int base = 10); -long stol (const string& str, size_t* idx = 0, int base = 10); -unsigned long stoul (const string& str, size_t* idx = 0, int base = 10); -long long stoll (const string& str, size_t* idx = 0, int base = 10); -unsigned long long stoull(const string& str, size_t* idx = 0, int base = 10); +int stoi (const string& str, size_t* idx = nullptr, int base = 10); +long stol (const string& str, size_t* idx = nullptr, int base = 10); +unsigned long stoul (const string& str, size_t* idx = nullptr, int base = 10); +long long stoll (const string& str, size_t* idx = nullptr, int base = 10); +unsigned long long stoull(const string& str, size_t* idx = nullptr, int base = 10); -float stof (const string& str, size_t* idx = 0); -double stod (const string& str, size_t* idx = 0); -long double stold(const string& str, size_t* idx = 0); +float stof (const string& str, size_t* idx = nullptr); +double stod (const string& str, size_t* idx = nullptr); +long double stold(const string& str, size_t* idx = nullptr); string to_string(int val); string to_string(unsigned val); @@ -466,15 +466,15 @@ string to_string(double val); string to_string(long double val); -int stoi (const wstring& str, size_t* idx = 0, int base = 10); -long stol (const wstring& str, size_t* idx = 0, int base = 10); -unsigned long stoul (const wstring& str, size_t* idx = 0, int base = 10); -long long stoll (const wstring& str, size_t* idx = 0, int base = 10); -unsigned long long stoull(const wstring& str, size_t* idx = 0, int base = 10); +int stoi (const wstring& str, size_t* idx = nullptr, int base = 10); +long stol (const wstring& str, size_t* idx = nullptr, int base = 10); +unsigned long stoul (const wstring& str, size_t* idx = nullptr, int base = 10); +long long stoll (const wstring& str, size_t* idx = nullptr, int base = 10); +unsigned long long stoull(const wstring& str, size_t* idx = nullptr, int base = 10); -float stof (const wstring& str, size_t* idx = 0); -double stod (const wstring& str, size_t* idx = 0); -long double stold(const wstring& str, size_t* idx = 0); +float stof (const wstring& str, size_t* idx = nullptr); +double stod (const wstring& str, size_t* idx = nullptr); +long double stold(const wstring& str, size_t* idx = nullptr); wstring to_wstring(int val); wstring to_wstring(unsigned val); @@ -3813,7 +3813,7 @@ return false; if (capacity() < __min_cap - 1) return false; - if (data() == 0) + if (data() == nullptr) return false; if (data()[size()] != value_type(0)) return false; @@ -4183,15 +4183,15 @@ typedef basic_string u32string; #endif // _LIBCPP_HAS_NO_UNICODE_CHARS -_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = 0, int __base = 10); +_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = nullptr, int __base = 10); -_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = 0); -_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = 0); -_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = 0); +_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = nullptr); +_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = nullptr); +_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = nullptr); _LIBCPP_FUNC_VIS string to_string(int __val); _LIBCPP_FUNC_VIS string to_string(unsigned __val); @@ -4203,15 +4203,15 @@ _LIBCPP_FUNC_VIS string to_string(double __val); _LIBCPP_FUNC_VIS string to_string(long double __val); -_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = 0, int __base = 10); -_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = 0, int __base = 10); +_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = nullptr, int __base = 10); +_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = nullptr, int __base = 10); -_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = 0); -_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = 0); -_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = 0); +_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = nullptr); +_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = nullptr); +_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = nullptr); _LIBCPP_FUNC_VIS wstring to_wstring(int __val); _LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val); Index: include/strstream =================================================================== --- include/strstream +++ include/strstream @@ -19,12 +19,12 @@ public: explicit strstreambuf(streamsize alsize_arg = 0); strstreambuf(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*)); - strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = 0); + strstreambuf(char* gnext_arg, streamsize n, char* pbeg_arg = nullptr); strstreambuf(const char* gnext_arg, streamsize n); - strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = 0); + strstreambuf(signed char* gnext_arg, streamsize n, signed char* pbeg_arg = nullptr); strstreambuf(const signed char* gnext_arg, streamsize n); - strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = 0); + strstreambuf(unsigned char* gnext_arg, streamsize n, unsigned char* pbeg_arg = nullptr); strstreambuf(const unsigned char* gnext_arg, streamsize n); strstreambuf(strstreambuf&& rhs); @@ -142,12 +142,12 @@ public: explicit strstreambuf(streamsize __alsize = 0); strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*)); - strstreambuf(char* __gnext, streamsize __n, char* __pbeg = 0); + strstreambuf(char* __gnext, streamsize __n, char* __pbeg = nullptr); strstreambuf(const char* __gnext, streamsize __n); - strstreambuf(signed char* __gnext, streamsize __n, signed char* __pbeg = 0); + strstreambuf(signed char* __gnext, streamsize __n, signed char* __pbeg = nullptr); strstreambuf(const signed char* __gnext, streamsize __n); - strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0); + strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = nullptr); strstreambuf(const unsigned char* __gnext, streamsize __n); #ifndef _LIBCPP_CXX03_LANG Index: include/system_error =================================================================== --- include/system_error +++ include/system_error @@ -253,7 +253,7 @@ template _LIBCPP_INLINE_VISIBILITY error_condition(_Ep __e, - typename enable_if::value>::type* = 0 + typename enable_if::value>::type* = nullptr ) _NOEXCEPT {*this = make_error_condition(__e);} @@ -325,7 +325,7 @@ template _LIBCPP_INLINE_VISIBILITY error_code(_Ep __e, - typename enable_if::value>::type* = 0 + typename enable_if::value>::type* = nullptr ) _NOEXCEPT {*this = make_error_code(__e);} Index: include/type_traits =================================================================== --- include/type_traits +++ include/type_traits @@ -868,7 +868,7 @@ } template struct _LIBCPP_TEMPLATE_VIS is_class - : public integral_constant(0)) == 1 && !is_union<_Tp>::value> {}; + : public integral_constant(nullptr)) == 1 && !is_union<_Tp>::value> {}; #endif @@ -1668,7 +1668,7 @@ template __two &__is_polymorphic_impl(...); template struct _LIBCPP_TEMPLATE_VIS is_polymorphic - : public integral_constant(0)) == 1> {}; + : public integral_constant(nullptr)) == 1> {}; #endif // __has_feature(is_polymorphic) Index: include/valarray =================================================================== --- include/valarray +++ include/valarray @@ -802,7 +802,7 @@ public: // construct/destroy: _LIBCPP_INLINE_VISIBILITY - valarray() : __begin_(0), __end_(0) {} + valarray() : __begin_(nullptr), __end_(nullptr) {} inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 explicit valarray(size_t __n); _LIBCPP_INLINE_VISIBILITY @@ -2764,8 +2764,8 @@ template inline valarray<_Tp>::valarray(size_t __n) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { if (__n) { @@ -2791,16 +2791,16 @@ template inline valarray<_Tp>::valarray(const value_type& __x, size_t __n) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { resize(__n, __x); } template valarray<_Tp>::valarray(const value_type* __p, size_t __n) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { if (__n) { @@ -2825,8 +2825,8 @@ template valarray<_Tp>::valarray(const valarray& __v) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { if (__v.size()) { @@ -2862,8 +2862,8 @@ template valarray<_Tp>::valarray(initializer_list __il) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { const size_t __n = __il.size(); if (__n) @@ -2892,8 +2892,8 @@ template valarray<_Tp>::valarray(const slice_array& __sa) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { const size_t __n = __sa.__size_; if (__n) @@ -2920,8 +2920,8 @@ template valarray<_Tp>::valarray(const gslice_array& __ga) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { const size_t __n = __ga.__1d_.size(); if (__n) @@ -2950,8 +2950,8 @@ template valarray<_Tp>::valarray(const mask_array& __ma) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { const size_t __n = __ma.__1d_.size(); if (__n) @@ -2980,8 +2980,8 @@ template valarray<_Tp>::valarray(const indirect_array& __ia) - : __begin_(0), - __end_(0) + : __begin_(nullptr), + __end_(nullptr) { const size_t __n = __ia.__1d_.size(); if (__n) Index: include/vector =================================================================== --- include/vector +++ include/vector @@ -530,7 +530,7 @@ !__is_forward_iterator<_InputIterator>::value && is_constructible< value_type, - typename iterator_traits<_InputIterator>::reference>::value>::type* = 0); + typename iterator_traits<_InputIterator>::reference>::value>::type* = nullptr); template vector(_ForwardIterator __first, typename enable_if<__is_forward_iterator<_ForwardIterator>::value && @@ -543,7 +543,7 @@ typename enable_if<__is_forward_iterator<_ForwardIterator>::value && is_constructible< value_type, - typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0); + typename iterator_traits<_ForwardIterator>::reference>::value>::type* = nullptr); _LIBCPP_INLINE_VISIBILITY ~vector() @@ -2262,17 +2262,17 @@ template vector(_InputIterator __first, _InputIterator __last, typename enable_if<__is_input_iterator <_InputIterator>::value && - !__is_forward_iterator<_InputIterator>::value>::type* = 0); + !__is_forward_iterator<_InputIterator>::value>::type* = nullptr); template vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a, typename enable_if<__is_input_iterator <_InputIterator>::value && - !__is_forward_iterator<_InputIterator>::value>::type* = 0); + !__is_forward_iterator<_InputIterator>::value>::type* = nullptr); template vector(_ForwardIterator __first, _ForwardIterator __last, - typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0); + typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = nullptr); template vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a, - typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0); + typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = nullptr); vector(const vector& __v); vector(const vector& __v, const allocator_type& __a); Index: src/ios.cpp =================================================================== --- src/ios.cpp +++ src/ios.cpp @@ -182,7 +182,7 @@ { size_t newcap = __ios_new_cap(req_size, __iarray_cap_); long* iarray = static_cast(realloc(__iarray_, newcap * sizeof(long))); - if (iarray == 0) + if (iarray == nullptr) { setstate(badbit); static long error; @@ -206,16 +206,16 @@ { size_t newcap = __ios_new_cap(req_size, __iarray_cap_); void** parray = static_cast(realloc(__parray_, newcap * sizeof(void *))); - if (parray == 0) + if (parray == nullptr) { setstate(badbit); static void* error; - error = 0; + error = nullptr; return error; } __parray_ = parray; for (void** p = __parray_ + __parray_size_; p < __parray_ + newcap; ++p) - *p = 0; + *p = nullptr; __parray_cap_ = newcap; } __parray_size_ = max(__parray_size_, req_size); @@ -232,11 +232,11 @@ { size_t newcap = __ios_new_cap(req_size, __event_cap_); event_callback* fns = static_cast(realloc(__fn_, newcap * sizeof(event_callback))); - if (fns == 0) + if (fns == nullptr) setstate(badbit); __fn_ = fns; int* indxs = static_cast(realloc(__index_, newcap * sizeof(int))); - if (indxs == 0) + if (indxs == nullptr) setstate(badbit); __index_ = indxs; __event_cap_ = newcap; @@ -282,14 +282,14 @@ __fmtflags_ = skipws | dec; __width_ = 0; __precision_ = 6; - __fn_ = 0; - __index_ = 0; + __fn_ = nullptr; + __index_ = nullptr; __event_size_ = 0; __event_cap_ = 0; - __iarray_ = 0; + __iarray_ = nullptr; __iarray_size_ = 0; __iarray_cap_ = 0; - __parray_ = 0; + __parray_ = nullptr; __parray_size_ = 0; __parray_cap_ = 0; ::new(&__loc_) locale; @@ -300,10 +300,10 @@ { // If we can't acquire the needed resources, throw bad_alloc (can't set badbit) // Don't alter *this until all needed resources are acquired - unique_ptr new_callbacks(0, free); - unique_ptr new_ints(0, free); - unique_ptr new_longs(0, free); - unique_ptr new_pointers(0, free); + unique_ptr new_callbacks(nullptr, free); + unique_ptr new_ints(nullptr, free); + unique_ptr new_longs(nullptr, free); + unique_ptr new_pointers(nullptr, free); if (__event_cap_ < rhs.__event_size_) { size_t newesize = sizeof(event_callback) * rhs.__event_size_; @@ -377,25 +377,25 @@ __width_ = rhs.__width_; __rdstate_ = rhs.__rdstate_; __exceptions_ = rhs.__exceptions_; - __rdbuf_ = 0; + __rdbuf_ = nullptr; locale& rhs_loc = *reinterpret_cast(&rhs.__loc_); ::new(&__loc_) locale(rhs_loc); __fn_ = rhs.__fn_; - rhs.__fn_ = 0; + rhs.__fn_ = nullptr; __index_ = rhs.__index_; - rhs.__index_ = 0; + rhs.__index_ = nullptr; __event_size_ = rhs.__event_size_; rhs.__event_size_ = 0; __event_cap_ = rhs.__event_cap_; rhs.__event_cap_ = 0; __iarray_ = rhs.__iarray_; - rhs.__iarray_ = 0; + rhs.__iarray_ = nullptr; __iarray_size_ = rhs.__iarray_size_; rhs.__iarray_size_ = 0; __iarray_cap_ = rhs.__iarray_cap_; rhs.__iarray_cap_ = 0; __parray_ = rhs.__parray_; - rhs.__parray_ = 0; + rhs.__parray_ = nullptr; __parray_size_ = rhs.__parray_size_; rhs.__parray_size_ = 0; __parray_cap_ = rhs.__parray_cap_; Index: src/locale.cpp =================================================================== --- src/locale.cpp +++ src/locale.cpp @@ -47,7 +47,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD struct __libcpp_unique_locale { - __libcpp_unique_locale(const char* nm) : __loc_(newlocale(LC_ALL_MASK, nm, 0)) {} + __libcpp_unique_locale(const char* nm) : __loc_(newlocale(LC_ALL_MASK, nm, nullptr)) {} ~__libcpp_unique_locale() { if (__loc_) @@ -536,7 +536,7 @@ locale::locale(const char* name) : __locale_(name ? new __imp(name) - : (__throw_runtime_error("locale constructed with null"), (__imp*)0)) + : (__throw_runtime_error("locale constructed with null"), nullptr)) { __locale_->__add_shared(); } @@ -549,7 +549,7 @@ locale::locale(const locale& other, const char* name, category c) : __locale_(name ? new __imp(*other.__locale_, name, c) - : (__throw_runtime_error("locale constructed with null"), (__imp*)0)) + : (__throw_runtime_error("locale constructed with null"), nullptr)) { __locale_->__add_shared(); } @@ -664,18 +664,18 @@ collate_byname::collate_byname(const char* n, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, n, 0)) + __l(newlocale(LC_ALL_MASK, n, nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("collate_byname::collate_byname" " failed to construct for " + string(n)); } collate_byname::collate_byname(const string& name, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + __l(newlocale(LC_ALL_MASK, name.c_str(), nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("collate_byname::collate_byname" " failed to construct for " + name); } @@ -703,7 +703,7 @@ collate_byname::do_transform(const char_type* lo, const char_type* hi) const { const string_type in(lo, hi); - string_type out(strxfrm_l(0, in.c_str(), 0, __l), char()); + string_type out(strxfrm_l(nullptr, in.c_str(), 0, __l), char()); strxfrm_l(const_cast(out.c_str()), in.c_str(), out.size()+1, __l); return out; } @@ -712,18 +712,18 @@ collate_byname::collate_byname(const char* n, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, n, 0)) + __l(newlocale(LC_ALL_MASK, n, nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("collate_byname::collate_byname(size_t refs)" " failed to construct for " + string(n)); } collate_byname::collate_byname(const string& name, size_t refs) : collate(refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + __l(newlocale(LC_ALL_MASK, name.c_str(), nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("collate_byname::collate_byname(size_t refs)" " failed to construct for " + name); } @@ -751,7 +751,7 @@ collate_byname::do_transform(const char_type* lo, const char_type* hi) const { const string_type in(lo, hi); - string_type out(wcsxfrm_l(0, in.c_str(), 0, __l), wchar_t()); + string_type out(wcsxfrm_l(nullptr, in.c_str(), 0, __l), wchar_t()); wcsxfrm_l(const_cast(out.c_str()), in.c_str(), out.size()+1, __l); return out; } @@ -910,7 +910,7 @@ __tab_(tab), __del_(del) { - if (__tab_ == 0) + if (__tab_ == nullptr) __tab_ = classic_table(); } @@ -1179,19 +1179,19 @@ // template <> class ctype_byname ctype_byname::ctype_byname(const char* name, size_t refs) - : ctype(0, false, refs), - __l(newlocale(LC_ALL_MASK, name, 0)) + : ctype(nullptr, false, refs), + __l(newlocale(LC_ALL_MASK, name, nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + string(name)); } ctype_byname::ctype_byname(const string& name, size_t refs) - : ctype(0, false, refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + : ctype(nullptr, false, refs), + __l(newlocale(LC_ALL_MASK, name.c_str(), nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + name); } @@ -1233,18 +1233,18 @@ ctype_byname::ctype_byname(const char* name, size_t refs) : ctype(refs), - __l(newlocale(LC_ALL_MASK, name, 0)) + __l(newlocale(LC_ALL_MASK, name, nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + string(name)); } ctype_byname::ctype_byname(const string& name, size_t refs) : ctype(refs), - __l(newlocale(LC_ALL_MASK, name.c_str(), 0)) + __l(newlocale(LC_ALL_MASK, name.c_str(), nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("ctype_byname::ctype_byname" " failed to construct for " + name); } @@ -1504,9 +1504,9 @@ codecvt::codecvt(const char* nm, size_t refs) : locale::facet(refs), - __l(newlocale(LC_ALL_MASK, nm, 0)) + __l(newlocale(LC_ALL_MASK, nm, nullptr)) { - if (__l == 0) + if (__l == nullptr) __throw_runtime_error("codecvt_byname::codecvt_byname" " failed to construct for " + string(nm)); } @@ -1664,7 +1664,7 @@ return -1; // stateless encoding - if (__l == 0 || __libcpp_mb_cur_max_l(__l) == 1) // there are no known constant length encodings + if (__l == nullptr || __libcpp_mb_cur_max_l(__l) == 1) // there are no known constant length encodings return 1; // which take more than 1 char to form a wchar_t return 0; } @@ -1704,7 +1704,7 @@ int codecvt::do_max_length() const _NOEXCEPT { - return __l == 0 ? 1 : static_cast(__libcpp_mb_cur_max_l(__l)); + return __l == nullptr ? 1 : static_cast(__libcpp_mb_cur_max_l(__l)); } // Valid UTF ranges @@ -4748,17 +4748,17 @@ // time_get_byname __time_get::__time_get(const char* nm) - : __loc_(newlocale(LC_ALL_MASK, nm, 0)) + : __loc_(newlocale(LC_ALL_MASK, nm, nullptr)) { - if (__loc_ == 0) + if (__loc_ == nullptr) __throw_runtime_error("time_get_byname" " failed to construct for " + string(nm)); } __time_get::__time_get(const string& nm) - : __loc_(newlocale(LC_ALL_MASK, nm.c_str(), 0)) + : __loc_(newlocale(LC_ALL_MASK, nm.c_str(), nullptr)) { - if (__loc_ == 0) + if (__loc_ == nullptr) __throw_runtime_error("time_get_byname" " failed to construct for " + nm); } @@ -5404,17 +5404,17 @@ // time_put __time_put::__time_put(const char* nm) - : __loc_(newlocale(LC_ALL_MASK, nm, 0)) + : __loc_(newlocale(LC_ALL_MASK, nm, nullptr)) { - if (__loc_ == 0) + if (__loc_ == nullptr) __throw_runtime_error("time_put_byname" " failed to construct for " + string(nm)); } __time_put::__time_put(const string& nm) - : __loc_(newlocale(LC_ALL_MASK, nm.c_str(), 0)) + : __loc_(newlocale(LC_ALL_MASK, nm.c_str(), nullptr)) { - if (__loc_ == 0) + if (__loc_ == nullptr) __throw_runtime_error("time_put_byname" " failed to construct for " + nm); } Index: src/new.cpp =================================================================== --- src/new.cpp +++ src/new.cpp @@ -64,7 +64,7 @@ if (size == 0) size = 1; void* p; - while ((p = ::malloc(size)) == 0) + while ((p = ::malloc(size)) == nullptr) { // If malloc fails and there is a new_handler, // call it to try free up memory. @@ -85,7 +85,7 @@ void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { - void* p = 0; + void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -111,7 +111,7 @@ void* operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT { - void* p = 0; + void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -206,7 +206,7 @@ void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT { - void* p = 0; + void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS try { @@ -232,7 +232,7 @@ void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT { - void* p = 0; + void* p = nullptr; #ifndef _LIBCPP_NO_EXCEPTIONS try { Index: src/thread.cpp =================================================================== --- src/thread.cpp +++ src/thread.cpp @@ -84,7 +84,7 @@ unsigned n; int mib[2] = {CTL_HW, HW_NCPU}; std::size_t s = sizeof(n); - sysctl(mib, 2, &n, &s, 0, 0); + sysctl(mib, 2, &n, &s, nullptr, 0); return n; #elif defined(_SC_NPROCESSORS_ONLN) long result = sysconf(_SC_NPROCESSORS_ONLN); Index: test/std/iterators/iterator.primitives/iterator.traits/empty.pass.cpp =================================================================== --- test/std/iterators/iterator.primitives/iterator.traits/empty.pass.cpp +++ test/std/iterators/iterator.primitives/iterator.traits/empty.pass.cpp @@ -27,9 +27,9 @@ private: struct two {char lx; char lxx;}; template static two test(...); - template static char test(typename U::value_type* = 0); + template static char test(typename U::value_type* = nullptr); public: - static const bool value = sizeof(test(0)) == 1; + static const bool value = sizeof(test(nullptr)) == 1; }; int main(int, char**) Index: test/std/numerics/complex.number/cmplx.over/arg.pass.cpp =================================================================== --- test/std/numerics/complex.number/cmplx.over/arg.pass.cpp +++ test/std/numerics/complex.number/cmplx.over/arg.pass.cpp @@ -21,7 +21,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::arg(x) == arg(std::complex(static_cast(x), 0))); @@ -29,7 +29,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::arg(x) == arg(std::complex(x, 0))); Index: test/std/numerics/complex.number/cmplx.over/conj.pass.cpp =================================================================== --- test/std/numerics/complex.number/cmplx.over/conj.pass.cpp +++ test/std/numerics/complex.number/cmplx.over/conj.pass.cpp @@ -23,7 +23,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same >::value), ""); assert(std::conj(x) == conj(std::complex(x, 0))); @@ -31,7 +31,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same >::value), ""); assert(std::conj(x) == conj(std::complex(x, 0))); @@ -40,7 +40,7 @@ template void test(T x, typename std::enable_if::value && - !std::is_floating_point::value>::type* = 0) + !std::is_floating_point::value>::type* = nullptr) { static_assert((std::is_same >::value), ""); assert(std::conj(x) == conj(std::complex(x, 0))); Index: test/std/numerics/complex.number/cmplx.over/imag.pass.cpp =================================================================== --- test/std/numerics/complex.number/cmplx.over/imag.pass.cpp +++ test/std/numerics/complex.number/cmplx.over/imag.pass.cpp @@ -21,7 +21,7 @@ template void -test(typename std::enable_if::value>::type* = 0) +test(typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::imag(x) == 0); @@ -35,7 +35,7 @@ template void -test(typename std::enable_if::value>::type* = 0) +test(typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::imag(x) == 0); Index: test/std/numerics/complex.number/cmplx.over/norm.pass.cpp =================================================================== --- test/std/numerics/complex.number/cmplx.over/norm.pass.cpp +++ test/std/numerics/complex.number/cmplx.over/norm.pass.cpp @@ -21,7 +21,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::norm(x) == norm(std::complex(static_cast(x), 0))); @@ -29,7 +29,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::norm(x) == norm(std::complex(x, 0))); Index: test/std/numerics/complex.number/cmplx.over/pow.pass.cpp =================================================================== --- test/std/numerics/complex.number/cmplx.over/pow.pass.cpp +++ test/std/numerics/complex.number/cmplx.over/pow.pass.cpp @@ -29,7 +29,7 @@ template double -promote(T, typename std::enable_if::value>::type* = 0); +promote(T, typename std::enable_if::value>::type* = nullptr); float promote(float); double promote(double); @@ -64,7 +64,7 @@ template void -test(typename std::enable_if::value>::type* = 0, typename std::enable_if::value>::type* = 0) +test(typename std::enable_if::value>::type* = nullptr, typename std::enable_if::value>::type* = nullptr) { test(T(3), std::complex(4, 5)); test(std::complex(3, 4), T(5)); @@ -72,7 +72,7 @@ template void -test(typename std::enable_if::value>::type* = 0, typename std::enable_if::value>::type* = 0) +test(typename std::enable_if::value>::type* = nullptr, typename std::enable_if::value>::type* = nullptr) { test(T(3), std::complex(4, 5)); test(std::complex(3, 4), U(5)); Index: test/std/numerics/complex.number/cmplx.over/proj.pass.cpp =================================================================== --- test/std/numerics/complex.number/cmplx.over/proj.pass.cpp +++ test/std/numerics/complex.number/cmplx.over/proj.pass.cpp @@ -23,7 +23,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same >::value), ""); assert(std::proj(x) == proj(std::complex(x, 0))); @@ -31,7 +31,7 @@ template void -test(T x, typename std::enable_if::value>::type* = 0) +test(T x, typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same >::value), ""); assert(std::proj(x) == proj(std::complex(x, 0))); @@ -40,7 +40,7 @@ template void test(T x, typename std::enable_if::value && - !std::is_floating_point::value>::type* = 0) + !std::is_floating_point::value>::type* = nullptr) { static_assert((std::is_same >::value), ""); assert(std::proj(x) == proj(std::complex(x, 0))); Index: test/std/numerics/complex.number/cmplx.over/real.pass.cpp =================================================================== --- test/std/numerics/complex.number/cmplx.over/real.pass.cpp +++ test/std/numerics/complex.number/cmplx.over/real.pass.cpp @@ -21,7 +21,7 @@ template void -test(typename std::enable_if::value>::type* = 0) +test(typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::real(x) == x); @@ -35,7 +35,7 @@ template void -test(typename std::enable_if::value>::type* = 0) +test(typename std::enable_if::value>::type* = nullptr) { static_assert((std::is_same::value), ""); assert(std::real(x) == x); Index: test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp =================================================================== --- test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp +++ test/std/utilities/function.objects/arithmetic.operations/transparent.pass.cpp @@ -18,9 +18,9 @@ private: struct two {char lx; char lxx;}; template static two test(...); - template static char test(typename U::is_transparent* = 0); + template static char test(typename U::is_transparent* = nullptr); public: - static const bool value = sizeof(test(0)) == 1; + static const bool value = sizeof(test(nullptr)) == 1; }; Index: test/std/utilities/function.objects/bitwise.operations/transparent.pass.cpp =================================================================== --- test/std/utilities/function.objects/bitwise.operations/transparent.pass.cpp +++ test/std/utilities/function.objects/bitwise.operations/transparent.pass.cpp @@ -18,9 +18,9 @@ private: struct two {char lx; char lxx;}; template static two test(...); - template static char test(typename U::is_transparent* = 0); + template static char test(typename U::is_transparent* = nullptr); public: - static const bool value = sizeof(test(0)) == 1; + static const bool value = sizeof(test(nullptr)) == 1; }; Index: test/std/utilities/function.objects/comparisons/transparent.pass.cpp =================================================================== --- test/std/utilities/function.objects/comparisons/transparent.pass.cpp +++ test/std/utilities/function.objects/comparisons/transparent.pass.cpp @@ -18,9 +18,9 @@ private: struct two {char lx; char lxx;}; template static two test(...); - template static char test(typename U::is_transparent* = 0); + template static char test(typename U::is_transparent* = nullptr); public: - static const bool value = sizeof(test(0)) == 1; + static const bool value = sizeof(test(nullptr)) == 1; }; Index: test/std/utilities/function.objects/logical.operations/transparent.pass.cpp =================================================================== --- test/std/utilities/function.objects/logical.operations/transparent.pass.cpp +++ test/std/utilities/function.objects/logical.operations/transparent.pass.cpp @@ -18,9 +18,9 @@ private: struct two {char lx; char lxx;}; template static two test(...); - template static char test(typename U::is_transparent* = 0); + template static char test(typename U::is_transparent* = nullptr); public: - static const bool value = sizeof(test(0)) == 1; + static const bool value = sizeof(test(nullptr)) == 1; }; Index: test/std/utilities/function.objects/refwrap/weak_result.pass.cpp =================================================================== --- test/std/utilities/function.objects/refwrap/weak_result.pass.cpp +++ test/std/utilities/function.objects/refwrap/weak_result.pass.cpp @@ -65,9 +65,9 @@ private: struct two {char _; char __;}; template static two test(...); - template static char test(typename U::result_type* = 0); + template static char test(typename U::result_type* = nullptr); public: - static const bool value = sizeof(test(0)) == 1; + static const bool value = sizeof(test(nullptr)) == 1; }; int main(int, char**) Index: test/support/deleter_types.h =================================================================== --- test/support/deleter_types.h +++ test/support/deleter_types.h @@ -48,13 +48,13 @@ template Deleter(Deleter&& d, - typename std::enable_if::value>::type* = 0) + typename std::enable_if::value>::type* = nullptr) : state_(d.state()) {d.set_state(0);} private: template Deleter(const Deleter& d, - typename std::enable_if::value>::type* = 0); + typename std::enable_if::value>::type* = nullptr); public: int state() const {return state_;} void set_state(int i) {state_ = i;} @@ -114,7 +114,7 @@ template Deleter(Deleter d, - typename std::enable_if::value>::type* = 0) + typename std::enable_if::value>::type* = nullptr) : state_(d.state()) {} public: @@ -401,7 +401,7 @@ template PointerDeleter(PointerDeleter&&, - typename std::enable_if::value>::type* = 0) + typename std::enable_if::value>::type* = nullptr) {} void operator()(pointer p) { if (p) { delete std::addressof(*p); }} @@ -409,7 +409,7 @@ private: template PointerDeleter(const PointerDeleter&, - typename std::enable_if::value>::type* = 0); + typename std::enable_if::value>::type* = nullptr); }; @@ -429,7 +429,7 @@ template PointerDeleter(PointerDeleter&&, - typename std::enable_if::value>::type* = 0) + typename std::enable_if::value>::type* = nullptr) {} void operator()(pointer p) { if (p) { delete [] std::addressof(*p); }} @@ -437,7 +437,7 @@ private: template PointerDeleter(const PointerDeleter&, - typename std::enable_if::value>::type* = 0); + typename std::enable_if::value>::type* = nullptr); }; #endif // TEST_STD_VER >= 11 Index: test/support/test_allocator.h =================================================================== --- test/support/test_allocator.h +++ test/support/test_allocator.h @@ -121,7 +121,7 @@ } pointer address(reference x) const {return &x;} const_pointer address(const_reference x) const {return &x;} - pointer allocate(size_type n, const void* = 0) + pointer allocate(size_type n, const void* = nullptr) { assert(data_ >= 0); if (time_to_throw >= throw_after) { @@ -185,7 +185,7 @@ ~non_default_test_allocator() TEST_NOEXCEPT {assert(data_ >= 0); --count; data_ = -1;} pointer address(reference x) const {return &x;} const_pointer address(const_reference x) const {return &x;} - pointer allocate(size_type n, const void* = 0) + pointer allocate(size_type n, const void* = nullptr) { assert(data_ >= 0); if (time_to_throw >= throw_after) {