Skip to content
2 changes: 1 addition & 1 deletion stl/inc/array
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ public:

template <class _Ty, size_t _Size, enable_if_t<_Size == 0 || _Is_swappable<_Ty>::value, int> = 0>
_CONSTEXPR20 void swap(array<_Ty, _Size>& _Left, array<_Ty, _Size>& _Right) noexcept(noexcept(_Left.swap(_Right))) {
return _Left.swap(_Right);
_Left.swap(_Right);
}

template <class _Ty, size_t _Size>
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/chrono
Original file line number Diff line number Diff line change
Expand Up @@ -4621,9 +4621,9 @@ concept _Has_ok = requires(_Ty _At) {
// A chrono spec is either a type (with an optional modifier), OR a literal character, never both.
template <class _CharT>
struct _Chrono_spec {
_CharT _Lit_char = _CharT{'\0'}; // any character other than '{', '}', or '%'
char _Modifier = '\0'; // either 'E' or 'O'
char _Type = '\0';
_CharT _Lit_char{'\0'}; // any character other than '{', '}', or '%'
char _Modifier = '\0'; // either 'E' or 'O'
char _Type = '\0';
};

template <class _CharT>
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/complex
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ namespace _Math_algorithms {
}

if (_Hypot_leg_tiny<_Ty> < _Av && _Av < _Hypot_leg_huge<_Ty>) { // no overflow or harmful underflow
constexpr _Ty _Norm_small = _Ty{0.5};
constexpr _Ty _Norm_big = _Ty{3.0};
constexpr _Ty _Norm_small{0.5};
constexpr _Ty _Norm_big{3.0};

const _Ty _Bv_sqr = _Bv * _Bv;

Expand Down
5 changes: 2 additions & 3 deletions stl/inc/cvt/ebcdic
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;

template <class _Elem, unsigned char _Maxcode = 0xff>
class codecvt_ebcdic
: public _STD
codecvt<_Elem, char, _Statype> { // facet for converting between ISO-8859-1 _Elem and EBCDIC bytes
class codecvt_ebcdic : public _STD codecvt<_Elem, char, _Statype> {
// facet for converting between ISO-8859-1 _Elem and EBCDIC bytes
static const unsigned char _Atoe[0x100];
static const unsigned char _Etoa[0x100];

Expand Down
5 changes: 2 additions & 3 deletions stl/inc/cvt/one_one
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ namespace stdext {
_STL_DISABLE_DEPRECATED_WARNING
template <class _Elem, unsigned long _Maxcode = 0xffffffff, _STD codecvt_mode _Mode = _STD codecvt_mode{},
size_t _Bytes_per_word = sizeof(_Elem)>
class codecvt_one_one
: public _STD
codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and serialized byte sequences
class codecvt_one_one : public _STD codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and serialized byte sequences
public:
static_assert(_Bytes_per_word >= 1 && _Bytes_per_word <= 4, "bad byte count parameter");

Expand Down
5 changes: 2 additions & 3 deletions stl/inc/cvt/utf16
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ namespace stdext {

_STL_DISABLE_DEPRECATED_WARNING
template <class _Elem, unsigned long _Maxcode = 0x10ffff, _STD codecvt_mode _Mode = _STD codecvt_mode{}>
class codecvt_utf16
: public _STD
codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and UTF-16 multibyte sequences
class codecvt_utf16 : public _STD codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and UTF-16 multibyte sequences
enum { _Bytes_per_word = 2 };

public:
Expand Down
5 changes: 2 additions & 3 deletions stl/inc/cvt/utf8
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ namespace stdext {

_STL_DISABLE_DEPRECATED_WARNING
template <class _Elem, unsigned long _Maxcode = 0xffffffff, _STD codecvt_mode _Mode = _STD codecvt_mode{}>
class codecvt_utf8
: public _STD
codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and UTF-8 byte sequences
class codecvt_utf8 : public _STD codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and UTF-8 byte sequences
public:
using _Mybase = _STD codecvt<_Elem, char, _Statype>;
using result = typename _Mybase::result;
Expand Down
5 changes: 2 additions & 3 deletions stl/inc/cvt/utf8_utf16
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ namespace stdext {
_STL_DISABLE_DEPRECATED_WARNING
template <class _Elem, unsigned long _Maxcode = 0x10ffff, _STD codecvt_mode _Mode = _STD codecvt_mode{},
class _Statype = _Mbstatype>
class codecvt_utf8_utf16
: public _STD
codecvt<_Elem, char, _Statype> { // facet for converting between UTF-16 _Elem and UTF-8 byte sequences
class codecvt_utf8_utf16 : public _STD codecvt<_Elem, char, _Statype> {
// facet for converting between UTF-16 _Elem and UTF-8 byte sequences
public:
using _Mybase = _STD codecvt<_Elem, char, _Statype>;
using result = typename _Mybase::result;
Expand Down
5 changes: 2 additions & 3 deletions stl/inc/cvt/xjis
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ namespace stdext {
#define _ESC_CODE 0x1b

template <class _Elem, unsigned long _Maxcode = 0xffff>
class codecvt_jis
: public _STD
codecvt<_Elem, char, _Statype> { // facet for converting between JIS-X0208 _Elem and UCS-2 bytes
class codecvt_jis : public _STD codecvt<_Elem, char, _Statype> {
// facet for converting between JIS-X0208 _Elem and UCS-2 bytes
using _Table = _tab_jis<int>;

bool _Jis_to_ucs(unsigned short& _Ch) const { // convert _Ch from JIS-X0208 to UCS-2
Expand Down
5 changes: 2 additions & 3 deletions stl/inc/cvt/xtwo_byte
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;

template <class _Elem, class _Table, unsigned long _Maxcode = 0xffff>
class _Cvt_two_byte
: public _STD
codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and one- or two-byte sequences
class _Cvt_two_byte : public _STD codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and one- or two-byte sequences
public:
using _Mybase = _STD codecvt<_Elem, char, _Statype>;
using result = typename _Mybase::result;
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/deque
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ private:
_Uninitialized_value_construct_n_unchecked1(_Myptr, _Count); // clear rest to initial block
}

if (_Map() != _Mapptr()) {
if (_Map() != nullptr) {
_Destroy_range(_Map(), _Map() + _Mapsize());
_Almap.deallocate(_Map(), _Mapsize()); // free storage for old
}
Expand All @@ -1483,7 +1483,7 @@ private:
pop_back();
}

if (_Map() != _Mapptr()) {
if (_Map() != nullptr) {
for (size_type _Block = _Mapsize(); _Block > 0;) { // free storage for a block and destroy pointer
if (_Map()[--_Block]) { // free block
_Getal().deallocate(_Map()[_Block], _Block_size);
Expand All @@ -1495,7 +1495,7 @@ private:
}

_Mapsize() = 0;
_Map() = _Mapptr();
_Map() = nullptr;
}

#if _ITERATOR_DEBUG_LEVEL == 2
Expand Down
17 changes: 2 additions & 15 deletions stl/inc/experimental/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -1008,13 +1008,7 @@ public:
return _Path_cvt<value_type, char16_t>::_Cvt(_Str, _Mystr.c_str(), _Mystr.size());
}

_STD u32string u32string() const = delete; // TRANSITION, ABI
#if 0
{ // return path as basic_string<char32_t> UTF32
_STD u32string _Str;
return _Path_cvt<value_type, char32_t>::_Cvt(_Str, _Mystr.c_str(), _Mystr.size());
}
#endif // 0
_STD u32string u32string() const = delete;

string_type _Make_generic() const { // copy and convert any '\' to '/'
string_type _Str = _Mystr;
Expand Down Expand Up @@ -1055,14 +1049,7 @@ public:
return _Path_cvt<value_type, char16_t>::_Cvt(_Str, _Genstr.c_str(), _Genstr.size());
}

_STD u32string generic_u32string() const = delete; // TRANSITION, ABI
#if 0
{ // return path as basic_string<char32_t> UTF32
_STD u32string _Str;
const string_type _Genstr = _Make_generic();
return _Path_cvt<value_type, char32_t>::_Cvt(_Str, _Genstr.c_str(), _Genstr.size());
}
#endif // 0
_STD u32string generic_u32string() const = delete;

_NODISCARD int compare(const path& _Path) const noexcept { // compare native() to _Path.native()
return _Mystr.compare(_Path._Mystr);
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ namespace filesystem {
_NODISCARD wstring _Convert_stringoid_to_wide(const wstring_view _Input, _Conversion) {
static_assert(
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4810 D.17 [depr.fs.path.factory]/1");
return wstring(_Input);
return wstring{_Input};
}

#ifdef __cpp_char8_t
Expand All @@ -271,7 +271,7 @@ namespace filesystem {
_NODISCARD wstring _Convert_stringoid_to_wide(const u16string_view _Input, _Conversion) {
static_assert(
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4810 D.17 [depr.fs.path.factory]/1");
return wstring(_Input.data(), _Input.data() + _Input.size());
return wstring{_Input.data(), _Input.data() + _Input.size()};
}

template <class _Conversion>
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -1264,8 +1264,8 @@ _NODISCARD constexpr const _CharT* _Parse_replacement_field(
_Handler._On_text(_First, _First + 1);
} else {
_Id_adapter<_CharT> _Adapter{_Handler._Parse_context};
_First = _Parse_arg_id(_First, _Last, _Adapter);
_CharT _Ch = _CharT{};
_First = _Parse_arg_id(_First, _Last, _Adapter);
_CharT _Ch{};
if (_First != _Last) {
_Ch = *_First;
}
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/forward_list
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ public:
// snip the node out
const auto _Removed = _Predecessor->_Next;
const auto _Next = _Removed->_Next;
_Removed->_Next = _Nodeptr();
_Removed->_Next = nullptr;
_Predecessor->_Next = _Next;

*_Tail = _Removed;
Expand Down
20 changes: 10 additions & 10 deletions stl/inc/future
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ public:
_Set_value_raw(_Val, &_Lock, _At_thread_exit);
}

void _Set_value_raw(const _Ty& _Val, unique_lock<mutex>* _Lock,
bool _At_thread_exit) { // store a result while inside a locked block
void _Set_value_raw(const _Ty& _Val, unique_lock<mutex>* _Lock, bool _At_thread_exit) {
// store a result while inside a locked block
if (_Already_has_stored_result()) {
_Throw_future_error2(future_errc::promise_already_satisfied);
}
Expand All @@ -337,8 +337,8 @@ public:
_Set_value_raw(_STD forward<_Ty>(_Val), &_Lock, _At_thread_exit);
}

void _Set_value_raw(_Ty&& _Val, unique_lock<mutex>* _Lock,
bool _At_thread_exit) { // store a result while inside a locked block
void _Set_value_raw(_Ty&& _Val, unique_lock<mutex>* _Lock, bool _At_thread_exit) {
// store a result while inside a locked block
if (_Already_has_stored_result()) {
_Throw_future_error2(future_errc::promise_already_satisfied);
}
Expand All @@ -352,8 +352,8 @@ public:
_Set_exception_raw(_Exc, &_Lock, _At_thread_exit);
}

void _Set_exception_raw(exception_ptr _Exc, unique_lock<mutex>* _Lock,
bool _At_thread_exit) { // store a result while inside a locked block
void _Set_exception_raw(exception_ptr _Exc, unique_lock<mutex>* _Lock, bool _At_thread_exit) {
// store a result while inside a locked block
if (_Already_has_stored_result()) {
_Throw_future_error2(future_errc::promise_already_satisfied);
}
Expand Down Expand Up @@ -454,8 +454,8 @@ public:
};

template <class _Ty, class _Derived, class _Alloc>
void _State_deleter<_Ty, _Derived, _Alloc>::_Delete(
_Associated_state<_Ty>* _State) { // delete _State and this using stored allocator
void _State_deleter<_Ty, _Derived, _Alloc>::_Delete(_Associated_state<_Ty>* _State) {
// delete _State and this using stored allocator
using _State_allocator = _Rebind_alloc_t<_Alloc, _Derived>;
_State_allocator _St_alloc(_My_alloc);

Expand Down Expand Up @@ -1507,8 +1507,8 @@ private:
};

template <class _Ret, class _Fty>
_Associated_state<typename _P_arg_type<_Ret>::type>* _Get_associated_state(
launch _Psync, _Fty&& _Fnarg) { // construct associated asynchronous state object for the launch type
_Associated_state<typename _P_arg_type<_Ret>::type>* _Get_associated_state(launch _Psync, _Fty&& _Fnarg) {
// construct associated asynchronous state object for the launch type
switch (_Psync) { // select launch type
case launch::deferred:
return new _Deferred_async_state<_Ret>(_STD forward<_Fty>(_Fnarg));
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/list
Original file line number Diff line number Diff line change
Expand Up @@ -1528,14 +1528,14 @@ public:

// snip the node out
--_List._Mypair._Myval2._Mysize;
const auto _Next = _STD exchange(_Removed->_Next, _Nodeptr());
const auto _Next = _STD exchange(_Removed->_Next, nullptr);
const auto _Prev = _Removed->_Prev;
_Prev->_Next = _Next;
_Next->_Prev = _Prev;

#if _ITERATOR_DEBUG_LEVEL == 2
// mark removed node for IDL to snip out later
_Removed->_Prev = _Nodeptr();
_Removed->_Prev = nullptr;
#endif // _ITERATOR_DEBUG_LEVEL == 2

*_Tail = _Removed;
Expand Down Expand Up @@ -1578,7 +1578,7 @@ public:
}

list& _List;
_Nodeptr _Head; // singly linked list of nodes to remove; their _Prev pointers set to _Nodeptr()
_Nodeptr _Head; // singly linked list of nodes to remove; their _Prev pointers set to nullptr
_Nodeptr* _Tail;
};

Expand Down
22 changes: 11 additions & 11 deletions stl/inc/locale
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public:
using char_type = _Elem;
using string_type = basic_string<_Elem, char_traits<_Elem>, allocator<_Elem>>;

_NODISCARD int compare(const _Elem* _First1, const _Elem* _Last1, const _Elem* _First2,
const _Elem* _Last2) const { // compare [_First1, _Last1) to [_First2, _Last2)
_NODISCARD int compare(const _Elem* _First1, const _Elem* _Last1, const _Elem* _First2, const _Elem* _Last2) const {
// compare [_First1, _Last1) to [_First2, _Last2)
return do_compare(_First1, _Last1, _First2, _Last2);
}

_NODISCARD string_type transform(
const _Elem* _First, const _Elem* _Last) const { // transform [_First, _Last) to key string
_NODISCARD string_type transform(const _Elem* _First, const _Elem* _Last) const {
// transform [_First, _Last) to key string
return do_transform(_First, _Last);
}

Expand Down Expand Up @@ -80,17 +80,17 @@ protected:
_Coll = _Lobj._Getcoll();
}

_NODISCARD virtual int __CLR_OR_THIS_CALL do_compare(const _Elem* _First1, const _Elem* _Last1,
const _Elem* _First2,
const _Elem* _Last2) const { // compare [_First1, _Last1) to [_First2, _Last2)
_NODISCARD virtual int __CLR_OR_THIS_CALL do_compare(
const _Elem* _First1, const _Elem* _Last1, const _Elem* _First2, const _Elem* _Last2) const {
// compare [_First1, _Last1) to [_First2, _Last2)
_Adl_verify_range(_First1, _Last1);
_Adl_verify_range(_First2, _Last2);
int _Ans = _LStrcoll(_First1, _Last1, _First2, _Last2, &_Coll);
return _Ans < 0 ? -1 : _Ans == 0 ? 0 : +1;
}

_NODISCARD virtual string_type __CLR_OR_THIS_CALL do_transform(const _Elem* _First,
const _Elem* _Last) const { // transform [_First, _Last) to key string
_NODISCARD virtual string_type __CLR_OR_THIS_CALL do_transform(const _Elem* _First, const _Elem* _Last) const {
// transform [_First, _Last) to key string
_Adl_verify_range(_First, _Last);
size_t _Count;
string_type _Str;
Expand All @@ -106,8 +106,8 @@ protected:
return _Str;
}

_NODISCARD virtual long __CLR_OR_THIS_CALL do_hash(
const _Elem* _First, const _Elem* _Last) const { // compute hash code for [_First, _Last)
_NODISCARD virtual long __CLR_OR_THIS_CALL do_hash(const _Elem* _First, const _Elem* _Last) const {
// compute hash code for [_First, _Last)
_Adl_verify_range(_First, _Last);
return static_cast<long>(_Hash_array_representation(_First, static_cast<size_t>(_Last - _First)));
}
Expand Down
Loading