Consistently use empty braces to construct tags (#497)

Fixes #468.
This commit is contained in:
Jean Philippe 2020-02-29 22:21:41 +00:00 коммит произвёл GitHub
Родитель a092e67713
Коммит 577827a79a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
20 изменённых файлов: 193 добавлений и 162 удалений

Просмотреть файл

@ -21,9 +21,8 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma warning(disable : 4127) // conditional expression is constant
_STD_BEGIN
#define _LITTLE_FIRST 1
#define _BIG_FIRST 2
#define _BYTES_PER_WORD 4
_INLINE_VAR constexpr int _Little_first = 1;
_INLINE_VAR constexpr int _Big_first = 2;
enum _CXX17_DEPRECATE_CODECVT_HEADER codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
@ -249,13 +248,13 @@ protected:
unsigned short _Ch0;
unsigned short _Ch1;
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _Little_first) {
_Ch0 = static_cast<unsigned short>(_Ptr[1] << 8 | _Ptr[0]);
} else if (*_Pstate == _BIG_FIRST) {
} else if (*_Pstate == _Big_first) {
_Ch0 = static_cast<unsigned short>(_Ptr[0] << 8 | _Ptr[1]);
} else { // no header seen yet, try preferred mode
constexpr bool _Prefer_LE = (_Mymode & little_endian) != 0;
constexpr char _Default_endian = _Prefer_LE ? _LITTLE_FIRST : _BIG_FIRST;
constexpr char _Default_endian = _Prefer_LE ? _Little_first : _Big_first;
if
_CONSTEXPR_IF(_Prefer_LE) {
@ -293,7 +292,7 @@ protected:
} else if (_Last1 - _Mid1 < 2 * _Bytes_per_word) {
break;
} else { // get second word
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _Little_first) {
_Ch1 = static_cast<unsigned short>(_Ptr[3] << 8 | _Ptr[2]);
} else {
_Ch1 = static_cast<unsigned short>(_Ptr[2] << 8 | _Ptr[3]);
@ -325,7 +324,7 @@ protected:
_Mid2 = _First2;
if (*_Pstate == 0) { // determine endianness once, maybe generate header
*_Pstate = (_Mymode & little_endian) != 0 ? _LITTLE_FIRST : _BIG_FIRST;
*_Pstate = (_Mymode & little_endian) != 0 ? _Little_first : _Big_first;
constexpr bool _Generating = (_Mymode & generate_header) != 0;
if
_CONSTEXPR_IF(_Generating) {
@ -333,7 +332,7 @@ protected:
return _Mybase::partial; // not enough room for all
}
if (*_Pstate == _LITTLE_FIRST) { // put header LS byte first
if (*_Pstate == _Little_first) { // put header LS byte first
*_Mid2++ = '\xff';
*_Mid2++ = '\xfe';
} else { // put header MS byte first
@ -362,7 +361,7 @@ protected:
_Extra = true;
}
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _Little_first) {
if (_Extra) { // put a pair of words LS byte first
unsigned short _Ch0 =
static_cast<unsigned short>(0xd800 | static_cast<unsigned short>(_Ch >> 10) - 0x0040);

Просмотреть файл

@ -62,17 +62,17 @@ namespace stdext {
const auto _Ptr = reinterpret_cast<const unsigned char*>(_Mid1);
unsigned long _Ch = 0;
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _STD _Little_first) {
for (_Count = _Bytes_per_word; 0 < _Count;) {
_Ch = _Ch << 8 | _Ptr[--_Count];
}
} else if (*_Pstate == _BIG_FIRST) {
} else if (*_Pstate == _STD _Big_first) {
for (_Count = 0; _Count < _Bytes_per_word; ++_Count) {
_Ch = _Ch << 8 | _Ptr[_Count];
}
} else { // no header seen yet, try preferred mode
constexpr unsigned char _Default_endian =
(_Mode & _STD little_endian) != 0 ? _LITTLE_FIRST : _BIG_FIRST;
constexpr unsigned char _Default_endian = static_cast<unsigned char>(
(_Mode & _STD little_endian) != 0 ? _STD _Little_first : _STD _Big_first);
if
_CONSTEXPR_IF((_Mode & _STD little_endian) != 0) {
@ -129,10 +129,10 @@ namespace stdext {
if
_CONSTEXPR_IF((_Mode & _STD little_endian) != 0) {
*_Pstate = _LITTLE_FIRST;
*_Pstate = _STD _Little_first;
}
else {
*_Pstate = _BIG_FIRST;
*_Pstate = _STD _Big_first;
}
if
@ -141,7 +141,7 @@ namespace stdext {
}
else if (_Last2 - _Mid2 < 2 * _Bytes_per_word) {
return _Mybase::partial; // not enough room for both
} else if (*_Pstate == _LITTLE_FIRST) {
} else if (*_Pstate == _STD _Little_first) {
for (_Count = 0; _Count < _Bytes_per_word; ++_Count) { // put LS byte first
*_Mid2++ = static_cast<_Byte>(static_cast<unsigned char>(_Header));
_Header >>= 8;
@ -162,7 +162,7 @@ namespace stdext {
return _Mybase::error;
}
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _STD _Little_first) {
for (_Count = 0; _Count < _Bytes_per_word; ++_Count) { // put LS byte first
*_Mid2++ = static_cast<_Byte>(static_cast<unsigned char>(_Ch));
_Ch >>= 8;

Просмотреть файл

@ -63,13 +63,13 @@ namespace stdext {
unsigned short _Ch0;
unsigned short _Ch1;
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _STD _Little_first) {
_Ch0 = static_cast<unsigned short>(_Ptr[1] << 8 | _Ptr[0]);
} else if (*_Pstate == _BIG_FIRST) {
} else if (*_Pstate == _STD _Big_first) {
_Ch0 = static_cast<unsigned short>(_Ptr[0] << 8 | _Ptr[1]);
} else { // no header seen yet, try preferred mode
constexpr unsigned char _Default_endian =
(_Mode & _STD little_endian) != 0 ? _LITTLE_FIRST : _BIG_FIRST;
constexpr unsigned char _Default_endian = static_cast<unsigned char>(
(_Mode & _STD little_endian) != 0 ? _STD _Little_first : _STD _Big_first);
if
_CONSTEXPR_IF((_Mode & _STD little_endian) != 0) {
@ -105,7 +105,7 @@ namespace stdext {
} else if (_Last1 - _Mid1 < 2 * _Bytes_per_word) {
break;
} else { // get second word
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _STD _Little_first) {
_Ch1 = static_cast<unsigned short>(_Ptr[3] << 8 | _Ptr[2]);
} else {
_Ch1 = static_cast<unsigned short>(_Ptr[2] << 8 | _Ptr[3]);
@ -138,10 +138,10 @@ namespace stdext {
if (*_Pstate == 0) { // determine endianness once, maybe generate header
if
_CONSTEXPR_IF((_Mode & _STD little_endian) != 0) {
*_Pstate = _LITTLE_FIRST;
*_Pstate = _STD _Little_first;
}
else {
*_Pstate = _BIG_FIRST;
*_Pstate = _STD _Big_first;
}
if
@ -150,7 +150,7 @@ namespace stdext {
return _Mybase::partial; // not enough room for both
}
if (*_Pstate == _LITTLE_FIRST) { // put header LS byte first
if (*_Pstate == _STD _Little_first) { // put header LS byte first
*_Mid2++ = '\xff';
*_Mid2++ = '\xfe';
} else { // put header MS byte first
@ -177,7 +177,7 @@ namespace stdext {
_Extra = true;
}
if (*_Pstate == _LITTLE_FIRST) {
if (*_Pstate == _STD _Little_first) {
if (!_Extra) { // put a single word LS byte first
*_Mid2++ = static_cast<_Byte>(_Ch);
*_Mid2++ = static_cast<_Byte>(_Ch >> 8);

Просмотреть файл

@ -592,23 +592,23 @@ public:
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
enum { _EEN_DS = _DEQUESIZ }; // helper for expression evaluator
deque() : _Mypair(_Zero_then_variadic_args_t()) {
deque() : _Mypair(_Zero_then_variadic_args_t{}) {
_Get_data()._Alloc_proxy(static_cast<_Alproxy_ty>(_Getal()));
}
explicit deque(const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
explicit deque(const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Get_data()._Alloc_proxy(static_cast<_Alproxy_ty>(_Getal()));
}
explicit deque(_CRT_GUARDOVERFLOW size_type _Count, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
resize(_Count);
_Proxy._Release();
}
deque(_CRT_GUARDOVERFLOW size_type _Count, const _Ty& _Val) : _Mypair(_Zero_then_variadic_args_t()) {
deque(_CRT_GUARDOVERFLOW size_type _Count, const _Ty& _Val) : _Mypair(_Zero_then_variadic_args_t{}) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
_Construct_n(_Count, _Val);
@ -616,7 +616,7 @@ public:
}
deque(_CRT_GUARDOVERFLOW size_type _Count, const _Ty& _Val, const _Alloc& _Al)
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
_Construct_n(_Count, _Val);
@ -624,14 +624,14 @@ public:
}
deque(const deque& _Right)
: _Mypair(_One_then_variadic_args_t(), _Alty_traits::select_on_container_copy_construction(_Right._Getal())) {
: _Mypair(_One_then_variadic_args_t{}, _Alty_traits::select_on_container_copy_construction(_Right._Getal())) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
_Construct(_Right._Unchecked_begin(), _Right._Unchecked_end());
_Proxy._Release();
}
deque(const deque& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
deque(const deque& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
_Construct(_Right._Unchecked_begin(), _Right._Unchecked_end());
@ -639,7 +639,7 @@ public:
}
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
deque(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t()) {
deque(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t{}) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
_Construct(_First, _Last);
@ -647,7 +647,7 @@ public:
}
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
deque(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
deque(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
_Construct(_First, _Last);
@ -703,12 +703,12 @@ private:
#define _PUSH_BACK_END ++_Mysize()
public:
deque(deque&& _Right) : _Mypair(_One_then_variadic_args_t(), _STD move(_Right._Getal())) {
deque(deque&& _Right) : _Mypair(_One_then_variadic_args_t{}, _STD move(_Right._Getal())) {
_Get_data()._Alloc_proxy(static_cast<_Alproxy_ty>(_Getal()));
_Take_contents(_Right);
}
deque(deque&& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
deque(deque&& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alproxy_ty _Alproxy(_Getal());
if
_CONSTEXPR_IF(!_Alty_traits::is_always_equal::value) {
@ -846,7 +846,7 @@ public:
}
deque(initializer_list<_Ty> _Ilist, const _Alloc& _Al = allocator_type())
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alproxy_ty _Alproxy(_Getal());
_Container_proxy_ptr12<_Alproxy_ty> _Proxy(_Alproxy, _Get_data());
_Construct(_Ilist.begin(), _Ilist.end());

Просмотреть файл

@ -4352,7 +4352,9 @@ _NODISCARD _Ty transform_reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last
}
// PARALLEL FUNCTION TEMPLATE exclusive_scan
struct _No_init_tag {}; // tag to indicate that no initial value is to be used
struct _No_init_tag {
explicit _No_init_tag() = default;
}; // tag to indicate that no initial value is to be used
template <class _FwdIt1, class _FwdIt2, class _BinOp, class _Ty>
_FwdIt2 _Exclusive_scan_per_chunk(_FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _Ty& _Val) {

Просмотреть файл

@ -542,12 +542,12 @@ public:
using _Unchecked_const_iterator = _Flist_unchecked_const_iterator<_Scary_val>;
forward_list() noexcept(is_nothrow_default_constructible_v<_Alnode>) // strengthened
: _Mypair(_Zero_then_variadic_args_t()) {
: _Mypair(_Zero_then_variadic_args_t{}) {
_Alloc_proxy();
}
explicit forward_list(_CRT_GUARDOVERFLOW size_type _Count, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct list from _Count * _Ty(), optional allocator
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct list from _Count * _Ty(), optional allocator
_Flist_insert_after_op2<_Alnode> _Insert_op(_Getal());
_Insert_op._Append_n(_Count);
_Alloc_proxy();
@ -555,7 +555,7 @@ public:
}
forward_list(_CRT_GUARDOVERFLOW size_type _Count, const _Ty& _Val)
: _Mypair(_Zero_then_variadic_args_t()) { // construct list from _Count * _Val
: _Mypair(_Zero_then_variadic_args_t{}) { // construct list from _Count * _Val
_Flist_insert_after_op2<_Alnode> _Insert_op(_Getal());
_Insert_op._Append_n(_Count, _Val);
_Alloc_proxy();
@ -563,7 +563,7 @@ public:
}
forward_list(_CRT_GUARDOVERFLOW size_type _Count, const _Ty& _Val, const _Alloc& _Al)
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct list from _Count * _Val, allocator
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct list from _Count * _Val, allocator
_Flist_insert_after_op2<_Alnode> _Insert_op(_Getal());
_Insert_op._Append_n(_Count, _Val);
_Alloc_proxy();
@ -571,19 +571,19 @@ public:
}
explicit forward_list(const _Alloc& _Al) noexcept // strengthened
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alloc_proxy();
}
forward_list(const forward_list& _Right)
: _Mypair(_One_then_variadic_args_t(), _Alnode_traits::select_on_container_copy_construction(_Right._Getal())) {
: _Mypair(_One_then_variadic_args_t{}, _Alnode_traits::select_on_container_copy_construction(_Right._Getal())) {
_Flist_insert_after_op2<_Alnode> _Insert_op(_Getal());
_Insert_op._Append_range_unchecked(_Right._Unchecked_begin(), _Right._Unchecked_end());
_Alloc_proxy();
_Insert_op._Attach_after(_Mypair._Myval2._Before_head());
}
forward_list(const forward_list& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
forward_list(const forward_list& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Flist_insert_after_op2<_Alnode> _Insert_op(_Getal());
_Insert_op._Append_range_unchecked(_Right._Unchecked_begin(), _Right._Unchecked_end());
_Alloc_proxy();
@ -591,7 +591,7 @@ public:
}
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
forward_list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t()) {
forward_list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t{}) {
_Adl_verify_range(_First, _Last);
_Flist_insert_after_op2<_Alnode> _Insert_op(_Getal());
_Insert_op._Append_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last));
@ -600,7 +600,7 @@ public:
}
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
forward_list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
forward_list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Adl_verify_range(_First, _Last);
_Flist_insert_after_op2<_Alnode> _Insert_op(_Getal());
_Insert_op._Append_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last));
@ -609,14 +609,14 @@ public:
}
forward_list(forward_list&& _Right) noexcept // strengthened
: _Mypair(_One_then_variadic_args_t(), _STD move(_Right._Getal())) {
: _Mypair(_One_then_variadic_args_t{}, _STD move(_Right._Getal())) {
_Alloc_proxy();
_Take_head(_Right);
}
forward_list(forward_list&& _Right, const _Alloc& _Al) noexcept(
_Alnode_traits::is_always_equal::value) // strengthened
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
if
_CONSTEXPR_IF(!_Alty_traits::is_always_equal::value) {
if (_Getal() != _Right._Getal()) {
@ -718,7 +718,7 @@ private:
public:
forward_list(initializer_list<_Ty> _Ilist, const _Alloc& _Al = allocator_type())
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alnode, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
insert_after(before_begin(), _Ilist.begin(), _Ilist.end());

Просмотреть файл

@ -672,7 +672,9 @@ struct identity {
#if _HAS_CXX17
// FUNCTION TEMPLATE not_fn
struct _Not_fn_tag {};
struct _Not_fn_tag {
explicit _Not_fn_tag() = default;
};
template <class _Decayed>
class _Not_fn : private _Ebco_base<_Decayed> {
@ -821,7 +823,7 @@ public:
template <class _Other1, class _Other2>
_Func_impl(_Other1&& _Val, _Other2&& _Ax)
: _Mypair(_One_then_variadic_args_t(), _STD forward<_Other2>(_Ax), _STD forward<_Other1>(_Val)) {}
: _Mypair(_One_then_variadic_args_t{}, _STD forward<_Other2>(_Ax), _STD forward<_Other1>(_Val)) {}
// dtor non-virtual due to _Delete_this()
@ -1457,7 +1459,7 @@ private:
public:
explicit _Binder(_Fx&& _Func, _Types&&... _Args)
: _Mypair(_One_then_variadic_args_t(), _STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...) {}
: _Mypair(_One_then_variadic_args_t{}, _STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...) {}
#define _BINDER_OPERATOR(CONST_OPT) \
template <class... _Unbound> \

Просмотреть файл

@ -801,17 +801,17 @@ public:
using reverse_iterator = _STD reverse_iterator<iterator>;
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
list() : _Mypair(_Zero_then_variadic_args_t()) {
list() : _Mypair(_Zero_then_variadic_args_t{}) {
_Alloc_sentinel_and_proxy();
}
explicit list(const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
explicit list(const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Alloc_sentinel_and_proxy();
}
private:
template <class _Any_alloc>
explicit list(_Move_allocator_tag, _Any_alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _STD move(_Al)) {
explicit list(_Move_allocator_tag, _Any_alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _STD move(_Al)) {
_Alloc_sentinel_and_proxy();
}
@ -826,12 +826,12 @@ private:
public:
explicit list(_CRT_GUARDOVERFLOW size_type _Count)
: _Mypair(_Zero_then_variadic_args_t()) { // construct list from _Count * _Ty()
: _Mypair(_Zero_then_variadic_args_t{}) { // construct list from _Count * _Ty()
_Construct_n(_Count);
}
explicit list(_CRT_GUARDOVERFLOW size_type _Count, const _Alloc& _Al)
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct list from _Count * _Ty(), with allocator
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct list from _Count * _Ty(), with allocator
_Construct_n(_Count);
}
@ -847,12 +847,12 @@ private:
public:
list(_CRT_GUARDOVERFLOW size_type _Count, const _Ty& _Val)
: _Mypair(_Zero_then_variadic_args_t()) { // construct list from _Count * _Val
: _Mypair(_Zero_then_variadic_args_t{}) { // construct list from _Count * _Val
_Construct_n(_Count, _Val);
}
list(_CRT_GUARDOVERFLOW size_type _Count, const _Ty& _Val, const _Alloc& _Al)
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct list from _Count * _Val, allocator
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct list from _Count * _Val, allocator
_Construct_n(_Count, _Val);
}
@ -869,32 +869,32 @@ private:
public:
list(const list& _Right)
: _Mypair(_One_then_variadic_args_t(), _Alnode_traits::select_on_container_copy_construction(_Right._Getal())) {
: _Mypair(_One_then_variadic_args_t{}, _Alnode_traits::select_on_container_copy_construction(_Right._Getal())) {
_Construct_range_unchecked(_Right._Unchecked_begin(), _Right._Unchecked_end());
}
list(const list& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
list(const list& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Construct_range_unchecked(_Right._Unchecked_begin(), _Right._Unchecked_end());
}
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t()) {
list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t{}) {
_Adl_verify_range(_First, _Last);
_Construct_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last));
}
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Adl_verify_range(_First, _Last);
_Construct_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last));
}
list(list&& _Right) : _Mypair(_One_then_variadic_args_t(), _STD move(_Right._Getal())) {
list(list&& _Right) : _Mypair(_One_then_variadic_args_t{}, _STD move(_Right._Getal())) {
_Alloc_sentinel_and_proxy();
_Swap_val(_Right);
}
list(list&& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
list(list&& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
if
_CONSTEXPR_IF(!_Alnode_traits::is_always_equal::value) {
if (_Getal() != _Right._Getal()) {
@ -1021,11 +1021,11 @@ public:
return _Op._Transfer_before(_Where);
}
list(initializer_list<_Ty> _Ilist) : _Mypair(_Zero_then_variadic_args_t()) {
list(initializer_list<_Ty> _Ilist) : _Mypair(_Zero_then_variadic_args_t{}) {
_Construct_range_unchecked(_Ilist.begin(), _Ilist.end());
}
list(initializer_list<_Ty> _Ilist, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
list(initializer_list<_Ty> _Ilist, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Construct_range_unchecked(_Ilist.begin(), _Ilist.end());
}

Просмотреть файл

@ -704,7 +704,7 @@ template <class _Resource, class _Dx>
class _Ref_count_resource : public _Ref_count_base { // handle reference counting for object with deleter
public:
_Ref_count_resource(_Resource _Px, _Dx _Dt)
: _Ref_count_base(), _Mypair(_One_then_variadic_args_t(), _STD move(_Dt), _Px) {}
: _Ref_count_base(), _Mypair(_One_then_variadic_args_t{}, _STD move(_Dt), _Px) {}
virtual void* _Get_deleter(const type_info& _Typeid) const noexcept override {
#if _HAS_STATIC_RTTI
@ -737,7 +737,7 @@ class _Ref_count_resource_alloc : public _Ref_count_base {
public:
_Ref_count_resource_alloc(_Resource _Px, _Dx _Dt, const _Alloc& _Ax)
: _Ref_count_base(),
_Mypair(_One_then_variadic_args_t(), _STD move(_Dt), _One_then_variadic_args_t(), _Ax, _Px) {}
_Mypair(_One_then_variadic_args_t{}, _STD move(_Dt), _One_then_variadic_args_t{}, _Ax, _Px) {}
virtual void* _Get_deleter(const type_info& _Typeid) const noexcept override {
#if _HAS_STATIC_RTTI
@ -1815,10 +1815,10 @@ public:
using deleter_type = _Dx;
template <class _Dx2 = _Dx, _Unique_ptr_enable_default_t<_Dx2> = 0>
constexpr unique_ptr() noexcept : _Mypair(_Zero_then_variadic_args_t()) {}
constexpr unique_ptr() noexcept : _Mypair(_Zero_then_variadic_args_t{}) {}
template <class _Dx2 = _Dx, _Unique_ptr_enable_default_t<_Dx2> = 0>
constexpr unique_ptr(nullptr_t) noexcept : _Mypair(_Zero_then_variadic_args_t()) {}
constexpr unique_ptr(nullptr_t) noexcept : _Mypair(_Zero_then_variadic_args_t{}) {}
unique_ptr& operator=(nullptr_t) noexcept {
reset();
@ -1826,14 +1826,14 @@ public:
}
template <class _Dx2 = _Dx, _Unique_ptr_enable_default_t<_Dx2> = 0>
explicit unique_ptr(pointer _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t(), _Ptr) {}
explicit unique_ptr(pointer _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t{}, _Ptr) {}
template <class _Dx2 = _Dx, enable_if_t<is_constructible_v<_Dx2, const _Dx2&>, int> = 0>
unique_ptr(pointer _Ptr, const _Dx& _Dt) noexcept : _Mypair(_One_then_variadic_args_t(), _Dt, _Ptr) {}
unique_ptr(pointer _Ptr, const _Dx& _Dt) noexcept : _Mypair(_One_then_variadic_args_t{}, _Dt, _Ptr) {}
template <class _Dx2 = _Dx,
enable_if_t<conjunction_v<negation<is_reference<_Dx2>>, is_constructible<_Dx2, _Dx2>>, int> = 0>
unique_ptr(pointer _Ptr, _Dx&& _Dt) noexcept : _Mypair(_One_then_variadic_args_t(), _STD move(_Dt), _Ptr) {}
unique_ptr(pointer _Ptr, _Dx&& _Dt) noexcept : _Mypair(_One_then_variadic_args_t{}, _STD move(_Dt), _Ptr) {}
template <class _Dx2 = _Dx,
enable_if_t<conjunction_v<is_reference<_Dx2>, is_constructible<_Dx2, remove_reference_t<_Dx2>>>, int> = 0>
@ -1843,7 +1843,7 @@ public:
template <class _Dx2 = _Dx, enable_if_t<is_move_constructible_v<_Dx2>, int> = 0>
#endif // _M_CEE
unique_ptr(unique_ptr&& _Right) noexcept
: _Mypair(_One_then_variadic_args_t(), _STD forward<_Dx>(_Right.get_deleter()), _Right.release()) {
: _Mypair(_One_then_variadic_args_t{}, _STD forward<_Dx>(_Right.get_deleter()), _Right.release()) {
}
template <class _Ty2, class _Dx2,
@ -1852,12 +1852,12 @@ public:
conditional_t<is_reference_v<_Dx>, is_same<_Dx2, _Dx>, is_convertible<_Dx2, _Dx>>>,
int> = 0>
unique_ptr(unique_ptr<_Ty2, _Dx2>&& _Right) noexcept
: _Mypair(_One_then_variadic_args_t(), _STD forward<_Dx2>(_Right.get_deleter()), _Right.release()) {}
: _Mypair(_One_then_variadic_args_t{}, _STD forward<_Dx2>(_Right.get_deleter()), _Right.release()) {}
#if _HAS_AUTO_PTR_ETC
template <class _Ty2,
enable_if_t<conjunction_v<is_convertible<_Ty2*, _Ty*>, is_same<_Dx, default_delete<_Ty>>>, int> = 0>
unique_ptr(auto_ptr<_Ty2>&& _Right) noexcept : _Mypair(_Zero_then_variadic_args_t(), _Right.release()) {}
unique_ptr(auto_ptr<_Ty2>&& _Right) noexcept : _Mypair(_Zero_then_variadic_args_t{}, _Right.release()) {}
#endif // _HAS_AUTO_PTR_ETC
template <class _Ty2, class _Dx2,
@ -1946,7 +1946,7 @@ public:
using deleter_type = _Dx;
template <class _Dx2 = _Dx, _Unique_ptr_enable_default_t<_Dx2> = 0>
constexpr unique_ptr() noexcept : _Mypair(_Zero_then_variadic_args_t()) {}
constexpr unique_ptr() noexcept : _Mypair(_Zero_then_variadic_args_t{}) {}
template <class _Uty, class _Is_nullptr = is_same<_Uty, nullptr_t>>
using _Enable_ctor_reset =
@ -1957,16 +1957,16 @@ public:
&& is_convertible_v<remove_pointer_t<_Uty> (*)[], element_type (*)[]>)>; // TRANSITION, GH-248
template <class _Uty, class _Dx2 = _Dx, _Unique_ptr_enable_default_t<_Dx2> = 0, class = _Enable_ctor_reset<_Uty>>
explicit unique_ptr(_Uty _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t(), _Ptr) {}
explicit unique_ptr(_Uty _Ptr) noexcept : _Mypair(_Zero_then_variadic_args_t{}, _Ptr) {}
template <class _Uty, class _Dx2 = _Dx, enable_if_t<is_constructible_v<_Dx2, const _Dx2&>, int> = 0,
class = _Enable_ctor_reset<_Uty>>
unique_ptr(_Uty _Ptr, const _Dx& _Dt) noexcept : _Mypair(_One_then_variadic_args_t(), _Dt, _Ptr) {}
unique_ptr(_Uty _Ptr, const _Dx& _Dt) noexcept : _Mypair(_One_then_variadic_args_t{}, _Dt, _Ptr) {}
template <class _Uty, class _Dx2 = _Dx,
enable_if_t<conjunction_v<negation<is_reference<_Dx2>>, is_constructible<_Dx2, _Dx2>>, int> = 0,
class = _Enable_ctor_reset<_Uty>>
unique_ptr(_Uty _Ptr, _Dx&& _Dt) noexcept : _Mypair(_One_then_variadic_args_t(), _STD move(_Dt), _Ptr) {}
unique_ptr(_Uty _Ptr, _Dx&& _Dt) noexcept : _Mypair(_One_then_variadic_args_t{}, _STD move(_Dt), _Ptr) {}
template <class _Uty, class _Dx2 = _Dx,
enable_if_t<conjunction_v<is_reference<_Dx2>, is_constructible<_Dx2, remove_reference_t<_Dx2>>>, int> = 0>
@ -1976,7 +1976,7 @@ public:
template <class _Dx2 = _Dx, enable_if_t<is_move_constructible_v<_Dx2>, int> = 0>
#endif // _M_CEE
unique_ptr(unique_ptr&& _Right) noexcept
: _Mypair(_One_then_variadic_args_t(), _STD forward<_Dx>(_Right.get_deleter()), _Right.release()) {
: _Mypair(_One_then_variadic_args_t{}, _STD forward<_Dx>(_Right.get_deleter()), _Right.release()) {
}
#ifndef _M_CEE // TRANSITION, VSO-1006185
@ -2001,7 +2001,7 @@ public:
class = _Enable_conversion<_Uty, _Ex,
conditional_t<is_reference_v<_Dx>, is_same<_Ex, _Dx>, is_convertible<_Ex, _Dx>>>>
unique_ptr(unique_ptr<_Uty, _Ex>&& _Right) noexcept
: _Mypair(_One_then_variadic_args_t(), _STD forward<_Ex>(_Right.get_deleter()), _Right.release()) {}
: _Mypair(_One_then_variadic_args_t{}, _STD forward<_Ex>(_Right.get_deleter()), _Right.release()) {}
template <class _Uty, class _Ex, class = _Enable_conversion<_Uty, _Ex, is_assignable<_Dx&, _Ex>>>
unique_ptr& operator=(unique_ptr<_Uty, _Ex>&& _Right) noexcept {
@ -2011,7 +2011,7 @@ public:
}
template <class _Dx2 = _Dx, _Unique_ptr_enable_default_t<_Dx2> = 0>
constexpr unique_ptr(nullptr_t) noexcept : _Mypair(_Zero_then_variadic_args_t()) {}
constexpr unique_ptr(nullptr_t) noexcept : _Mypair(_Zero_then_variadic_args_t{}) {}
unique_ptr& operator=(nullptr_t) noexcept {
reset();

Просмотреть файл

@ -1823,13 +1823,13 @@ public:
basic_regex() : _Rep(nullptr) {} // construct empty object
explicit basic_regex(_In_z_ const _Elem* _Ptr, flag_type _Flags = regex_constants::ECMAScript) : _Rep(nullptr) {
_Reset(_Ptr, _Ptr + _RxTraits::length(_Ptr), _Flags, random_access_iterator_tag());
_Reset(_Ptr, _Ptr + _RxTraits::length(_Ptr), _Flags, random_access_iterator_tag{});
}
basic_regex(_In_reads_(_Count) const _Elem* _Ptr, size_t _Count, flag_type _Flags = regex_constants::ECMAScript)
: _Rep(nullptr) {
if (_Ptr) {
_Reset(_Ptr, _Ptr + _Count, _Flags, random_access_iterator_tag());
_Reset(_Ptr, _Ptr + _Count, _Flags, random_access_iterator_tag{});
return;
}
@ -1840,7 +1840,7 @@ public:
explicit basic_regex(
const basic_string<_Elem, _STtraits, _STalloc>& _Str, flag_type _Flags = regex_constants::ECMAScript)
: _Rep(nullptr) {
_Reset(_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), _Flags, random_access_iterator_tag());
_Reset(_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), _Flags, random_access_iterator_tag{});
}
template <class _InIt>
@ -1866,7 +1866,7 @@ public:
}
basic_regex(initializer_list<_Elem> _Ilist, flag_type _Flags = regex_constants::ECMAScript) : _Rep(nullptr) {
_Reset(_Ilist.begin(), _Ilist.end(), _Flags, random_access_iterator_tag());
_Reset(_Ilist.begin(), _Ilist.end(), _Flags, random_access_iterator_tag{});
}
basic_regex& operator=(initializer_list<_Elem> _Ilist) { // replace with regular expression in initializer_list
@ -1875,7 +1875,7 @@ public:
basic_regex& assign(initializer_list<_Elem> _Ilist, flag_type _Flags = regex_constants::ECMAScript) {
// replace with regular expression in initializer_list
_Reset(_Ilist.begin(), _Ilist.end(), _Flags, random_access_iterator_tag());
_Reset(_Ilist.begin(), _Ilist.end(), _Flags, random_access_iterator_tag{});
return *this;
}
@ -1915,14 +1915,14 @@ public:
}
basic_regex& operator=(_In_z_ const _Elem* _Ptr) {
_Reset(_Ptr, _Ptr + _RxTraits::length(_Ptr), ECMAScript, random_access_iterator_tag());
_Reset(_Ptr, _Ptr + _RxTraits::length(_Ptr), ECMAScript, random_access_iterator_tag{});
return *this;
}
template <class _STtraits, class _STalloc>
basic_regex& operator=(const basic_string<_Elem, _STtraits, _STalloc>& _Str) {
_Reset(
_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), ECMAScript, random_access_iterator_tag());
_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), ECMAScript, random_access_iterator_tag{});
return *this;
}
@ -1949,14 +1949,14 @@ public:
basic_regex& assign(
_In_reads_(_Count) const _Elem* _Ptr, size_t _Count, flag_type _Flags = regex_constants::ECMAScript) {
_Reset(_Ptr, _Ptr + _Count, _Flags, random_access_iterator_tag());
_Reset(_Ptr, _Ptr + _Count, _Flags, random_access_iterator_tag{});
return *this;
}
template <class _STtraits, class _STalloc>
basic_regex& assign(
const basic_string<_Elem, _STtraits, _STalloc>& _Str, flag_type _Flags = regex_constants::ECMAScript) {
_Reset(_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), _Flags, random_access_iterator_tag());
_Reset(_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), _Flags, random_access_iterator_tag{});
return *this;
}
@ -2021,7 +2021,7 @@ private:
// build regular expression from input iterators
basic_string<_Iter_value_t<_InIt>> _Str(_First, _Last);
_Reset(_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), _Flags, forward_iterator_tag());
_Reset(_Str.data(), _Str.data() + static_cast<ptrdiff_t>(_Str.size()), _Flags, forward_iterator_tag{});
}
template <class _FwdIt>

Просмотреть файл

@ -59,7 +59,9 @@ class scoped_allocator_adaptor;
template <class _Outer, class... _Inner>
struct _Scoped_base;
struct _Secret_scoped_allocator_construct_tag {};
struct _Secret_scoped_allocator_construct_tag {
explicit _Secret_scoped_allocator_construct_tag() = default;
};
template <class _Outer, class _Inner0, class... _Inner>
struct _Scoped_base<_Outer, _Inner0, _Inner...> : _Outer { // nest of allocators, arbitrary depth

Просмотреть файл

@ -182,13 +182,21 @@ struct _Tuple_val { // stores each value in a tuple
};
// CLASS TEMPLATE tuple
struct _Exact_args_t {}; // tag type to disambiguate construction (from one arg per element)
struct _Exact_args_t {
explicit _Exact_args_t() = default;
}; // tag type to disambiguate construction (from one arg per element)
struct _Unpack_tuple_t {}; // tag type to disambiguate construction (from unpacking a tuple/pair)
struct _Unpack_tuple_t {
explicit _Unpack_tuple_t() = default;
}; // tag type to disambiguate construction (from unpacking a tuple/pair)
struct _Alloc_exact_args_t {}; // tag type to disambiguate construction (from an allocator and one arg per element)
struct _Alloc_exact_args_t {
explicit _Alloc_exact_args_t() = default;
}; // tag type to disambiguate construction (from an allocator and one arg per element)
struct _Alloc_unpack_tuple_t {}; // tag type to disambiguate construction (from an allocator and unpacking a tuple/pair)
struct _Alloc_unpack_tuple_t {
explicit _Alloc_unpack_tuple_t() = default;
}; // tag type to disambiguate construction (from an allocator and unpacking a tuple/pair)
template <class... _Types>
class tuple;

Просмотреть файл

@ -1621,7 +1621,9 @@ _IMPLEMENT_INVOKE(_C_, constexpr)
template <class _Rx, bool = is_void_v<_Rx>>
struct _Invoker_ret {}; // helper to give INVOKE an explicit return type; avoids undesirable Expression SFINAE
struct _Unforced {}; // tag to distinguish bind() from bind<R>()
struct _Unforced {
explicit _Unforced() = default;
}; // tag to distinguish bind() from bind<R>()
template <class _Cv_void>
struct _Invoker_ret<_Cv_void, true> { // selected for _Rx being cv void

Просмотреть файл

@ -357,6 +357,7 @@ struct _Vec_iter_types {
// STRUCT _Value_init_tag
struct _Value_init_tag { // tag to request value-initialization
explicit _Value_init_tag() = default;
};
// CLASS TEMPLATE _Vector_val
@ -441,11 +442,11 @@ public:
using reverse_iterator = _STD reverse_iterator<iterator>;
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
vector() noexcept(is_nothrow_default_constructible_v<_Alty>) : _Mypair(_Zero_then_variadic_args_t()) {
vector() noexcept(is_nothrow_default_constructible_v<_Alty>) : _Mypair(_Zero_then_variadic_args_t{}) {
_Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal()));
}
explicit vector(const _Alloc& _Al) noexcept : _Mypair(_One_then_variadic_args_t(), _Al) {
explicit vector(const _Alloc& _Al) noexcept : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal()));
}
@ -467,12 +468,12 @@ private:
public:
explicit vector(_CRT_GUARDOVERFLOW const size_type _Count, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
_Construct_n_copies_of_ty(_Count, _Value_init_tag{});
}
vector(_CRT_GUARDOVERFLOW const size_type _Count, const _Ty& _Val, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
_Construct_n_copies_of_ty(_Count, _Val);
}
@ -501,7 +502,7 @@ private:
public:
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
vector(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t(), _Al) {
vector(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Adl_verify_range(_First, _Last);
@ -509,7 +510,7 @@ public:
_Proxy._Release();
}
vector(initializer_list<_Ty> _Ilist, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t(), _Al) {
vector(initializer_list<_Ty> _Ilist, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Range_construct_or_tidy(_Ilist.begin(), _Ilist.end(), random_access_iterator_tag{});
@ -517,7 +518,7 @@ public:
}
vector(const vector& _Right)
: _Mypair(_One_then_variadic_args_t(), _Alty_traits::select_on_container_copy_construction(_Right._Getal())) {
: _Mypair(_One_then_variadic_args_t{}, _Alty_traits::select_on_container_copy_construction(_Right._Getal())) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
auto& _My_data = _Mypair._Myval2;
const auto& _Right_data = _Right._Mypair._Myval2;
@ -534,7 +535,7 @@ public:
_Proxy._Release();
}
vector(const vector& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
vector(const vector& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
auto& _My_data = _Mypair._Myval2;
const auto& _Right_data = _Right._Mypair._Myval2;
@ -578,13 +579,13 @@ private:
}
public:
vector(vector&& _Right) noexcept : _Mypair(_One_then_variadic_args_t(), _STD move(_Right._Getal())) {
vector(vector&& _Right) noexcept : _Mypair(_One_then_variadic_args_t{}, _STD move(_Right._Getal())) {
_Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal()));
_Move_construct(_Right, true_type{});
}
vector(vector&& _Right, const _Alloc& _Al) noexcept(_Alty_traits::is_always_equal::value) // strengthened
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Move_construct(_Right, typename _Alty_traits::is_always_equal::type{});

Просмотреть файл

@ -1268,8 +1268,9 @@ using _Iterator_base = _Iterator_base12;
// ALIAS TEMPLATE _Container_proxy_ptr AND SUPPORTING MACHINERY
struct _Leave_proxy_unbound {}; // tag to indicate that a proxy is being allocated before it is safe to bind to a
// _Container_base12
struct _Leave_proxy_unbound {
explicit _Leave_proxy_unbound() = default;
}; // tag to indicate that a proxy is being allocated before it is safe to bind to a _Container_base12
struct _Fake_proxy_ptr_impl { // fake replacement for a container proxy smart pointer when no container proxy is in use
_Fake_proxy_ptr_impl(const _Fake_proxy_ptr_impl&) = delete;
@ -1337,9 +1338,12 @@ using _Container_proxy_ptr = _Container_proxy_ptr12<_Rebind_alloc_t<_Alloc, _Con
#endif // _ITERATOR_DEBUG_LEVEL == 0
// CLASS TEMPLATE _Compressed_pair
struct _Zero_then_variadic_args_t {}; // tag type for value-initializing first, constructing second from remaining args
struct _Zero_then_variadic_args_t {
explicit _Zero_then_variadic_args_t() = default;
}; // tag type for value-initializing first, constructing second from remaining args
struct _One_then_variadic_args_t {
explicit _One_then_variadic_args_t() = default;
}; // tag type for constructing first from one arg, constructing second from remaining args
template <class _Ty1, class _Ty2, bool = is_empty_v<_Ty1> && !is_final_v<_Ty1>>
@ -1393,7 +1397,9 @@ public:
}
};
struct _Move_allocator_tag {};
struct _Move_allocator_tag {
explicit _Move_allocator_tag() = default;
};
// FUNCTION TEMPLATE _Get_temporary_buffer
template <class _Ty>

Просмотреть файл

@ -2273,32 +2273,32 @@ private:
public:
basic_string(const basic_string& _Right)
: _Mypair(_One_then_variadic_args_t(), _Alty_traits::select_on_container_copy_construction(_Right._Getal())) {
: _Mypair(_One_then_variadic_args_t{}, _Alty_traits::select_on_container_copy_construction(_Right._Getal())) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Construct_lv_contents(_Right);
_Proxy._Release();
}
basic_string(const basic_string& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
basic_string(const basic_string& _Right, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Construct_lv_contents(_Right);
_Proxy._Release();
}
basic_string() noexcept(is_nothrow_default_constructible_v<_Alty>) : _Mypair(_Zero_then_variadic_args_t()) {
basic_string() noexcept(is_nothrow_default_constructible_v<_Alty>) : _Mypair(_Zero_then_variadic_args_t{}) {
_Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal()));
_Tidy_init();
}
explicit basic_string(const _Alloc& _Al) noexcept : _Mypair(_One_then_variadic_args_t(), _Al) {
explicit basic_string(const _Alloc& _Al) noexcept : _Mypair(_One_then_variadic_args_t{}, _Al) {
_Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal()));
_Tidy_init();
}
basic_string(const basic_string& _Right, const size_type _Roff, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct from _Right [_Roff, <end>)
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct from _Right [_Roff, <end>)
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2308,7 +2308,7 @@ public:
basic_string(
const basic_string& _Right, const size_type _Roff, const size_type _Count, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct from _Right [_Roff, _Roff + _Count)
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct from _Right [_Roff, _Roff + _Count)
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2317,7 +2317,7 @@ public:
}
basic_string(_In_reads_(_Count) const _Elem* const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count)
: _Mypair(_Zero_then_variadic_args_t()) {
: _Mypair(_Zero_then_variadic_args_t{}) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2327,7 +2327,7 @@ public:
basic_string(
_In_reads_(_Count) const _Elem* const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count, const _Alloc& _Al)
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2335,7 +2335,7 @@ public:
_Proxy._Release();
}
basic_string(_In_z_ const _Elem* const _Ptr) : _Mypair(_Zero_then_variadic_args_t()) {
basic_string(_In_z_ const _Elem* const _Ptr) : _Mypair(_Zero_then_variadic_args_t{}) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2346,7 +2346,7 @@ public:
#if _HAS_CXX17
template <class _Alloc2 = _Alloc, enable_if_t<_Is_allocator<_Alloc2>::value, int> = 0>
#endif // _HAS_CXX17
basic_string(_In_z_ const _Elem* const _Ptr, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t(), _Al) {
basic_string(_In_z_ const _Elem* const _Ptr, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2354,7 +2354,7 @@ public:
_Proxy._Release();
}
basic_string(_CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch) : _Mypair(_Zero_then_variadic_args_t()) {
basic_string(_CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch) : _Mypair(_Zero_then_variadic_args_t{}) {
// construct from _Count * _Ch
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
@ -2367,7 +2367,7 @@ public:
template <class _Alloc2 = _Alloc, enable_if_t<_Is_allocator<_Alloc2>::value, int> = 0>
#endif // _HAS_CXX17
basic_string(_CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch, const _Alloc& _Al)
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct from _Count * _Ch with allocator
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct from _Count * _Ch with allocator
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2376,7 +2376,7 @@ public:
}
template <class _Iter, enable_if_t<_Is_iterator_v<_Iter>, int> = 0>
basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t(), _Al) {
basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2401,7 +2401,7 @@ public:
// initialize from [_First, _Last), forward iterators
const size_type _Count = _Convert_size<size_type>(static_cast<size_t>(_STD distance(_First, _Last)));
reserve(_Count);
_Construct(_First, _Last, input_iterator_tag());
_Construct(_First, _Last, input_iterator_tag{});
}
void _Construct(_Elem* const _First, _Elem* const _Last, random_access_iterator_tag) {
@ -2418,14 +2418,14 @@ public:
}
}
basic_string(basic_string&& _Right) noexcept : _Mypair(_One_then_variadic_args_t(), _STD move(_Right._Getal())) {
basic_string(basic_string&& _Right) noexcept : _Mypair(_One_then_variadic_args_t{}, _STD move(_Right._Getal())) {
_Mypair._Myval2._Alloc_proxy(_GET_PROXY_ALLOCATOR(_Alty, _Getal()));
_Take_contents(_Right, bool_constant<_Can_memcpy_val>{});
}
basic_string(basic_string&& _Right, const _Alloc& _Al) noexcept(
_Alty_traits::is_always_equal::value) // strengthened
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
if
@ -2444,7 +2444,7 @@ public:
basic_string(_String_constructor_concat_tag, const basic_string& _Source_of_al, const _Elem* const _Left_ptr,
const size_type _Left_size, const _Elem* const _Right_ptr, const size_type _Right_size)
: _Mypair(
_One_then_variadic_args_t(), _Alty_traits::select_on_container_copy_construction(_Source_of_al._Getal())) {
_One_then_variadic_args_t{}, _Alty_traits::select_on_container_copy_construction(_Source_of_al._Getal())) {
_STL_INTERNAL_CHECK(_Left_size <= max_size());
_STL_INTERNAL_CHECK(_Right_size <= max_size());
_STL_INTERNAL_CHECK(_Right_size <= max_size() - _Left_size);
@ -2470,7 +2470,7 @@ public:
}
basic_string(_String_constructor_concat_tag, basic_string& _Left, basic_string& _Right)
: _Mypair(_One_then_variadic_args_t(), _Left._Getal()) {
: _Mypair(_One_then_variadic_args_t{}, _Left._Getal()) {
auto& _My_data = _Mypair._Myval2;
auto& _Left_data = _Left._Mypair._Myval2;
auto& _Right_data = _Right._Mypair._Myval2;
@ -2538,7 +2538,7 @@ public:
#if _HAS_CXX17
template <class _StringViewIsh, _Is_string_view_ish<_StringViewIsh> = 0>
explicit basic_string(const _StringViewIsh& _Right, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2549,7 +2549,7 @@ public:
template <class _StringViewIsh, _Is_string_view_ish<_StringViewIsh> = 0>
basic_string(
const _StringViewIsh& _Right, const size_type _Roff, const size_type _Count, const _Alloc& _Al = _Alloc())
: _Mypair(_One_then_variadic_args_t(), _Al) { // construct from _Right [_Roff, _Roff + _Count) using _Al
: _Mypair(_One_then_variadic_args_t{}, _Al) { // construct from _Right [_Roff, _Roff + _Count) using _Al
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();
@ -2678,7 +2678,7 @@ private:
public:
basic_string(initializer_list<_Elem> _Ilist, const _Alloc& _Al = allocator_type())
: _Mypair(_One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Al) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alty, _Getal());
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, _Mypair._Myval2);
_Tidy_init();

Просмотреть файл

@ -874,34 +874,39 @@ public:
using reverse_iterator = _STD reverse_iterator<iterator>;
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
struct _Copy_tag {};
struct _Move_tag {};
struct _Copy_tag {
explicit _Copy_tag() = default;
};
_Tree(const key_compare& _Parg) : _Mypair(_One_then_variadic_args_t(), _Parg, _Zero_then_variadic_args_t()) {
struct _Move_tag {
explicit _Move_tag() = default;
};
_Tree(const key_compare& _Parg) : _Mypair(_One_then_variadic_args_t{}, _Parg, _Zero_then_variadic_args_t{}) {
_Alloc_sentinel_and_proxy();
}
_Tree(const key_compare& _Parg, const allocator_type& _Al)
: _Mypair(_One_then_variadic_args_t(), _Parg, _One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Parg, _One_then_variadic_args_t{}, _Al) {
_Alloc_sentinel_and_proxy();
}
template <class _Any_alloc>
_Tree(const _Tree& _Right, _Any_alloc&& _Al)
: _Mypair(_One_then_variadic_args_t(), _Right.key_comp(), _One_then_variadic_args_t(),
: _Mypair(_One_then_variadic_args_t{}, _Right.key_comp(), _One_then_variadic_args_t{},
_STD forward<_Any_alloc>(_Al)) {
auto&& _Alproxy = _GET_PROXY_ALLOCATOR(_Alnode, _Getal());
const auto _Scary = _Get_scary();
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, *_Scary);
_Tree_head_scoped_ptr<_Alnode, _Scary_val> _Sentinel(_Getal(), *_Scary);
_Copy(_Right, _Copy_tag());
_Copy(_Right, _Copy_tag{});
_Sentinel._Release();
_Proxy._Release();
}
_Tree(_Tree&& _Right)
: _Mypair(
_One_then_variadic_args_t(), _Right.key_comp(), _One_then_variadic_args_t(), _STD move(_Right._Getal())) {
_One_then_variadic_args_t{}, _Right.key_comp(), _One_then_variadic_args_t{}, _STD move(_Right._Getal())) {
_Alloc_sentinel_and_proxy();
_Swap_val(_Right);
}
@ -913,14 +918,14 @@ private:
const auto _Scary = _Get_scary();
_Container_proxy_ptr<_Alty> _Proxy(_Alproxy, *_Scary);
_Tree_head_scoped_ptr<_Alnode, _Scary_val> _Sentinel(_Getal(), *_Scary);
_Copy(_Right, _Move_tag());
_Copy(_Right, _Move_tag{});
_Sentinel._Release();
_Proxy._Release();
}
public:
_Tree(_Tree&& _Right, const allocator_type& _Al)
: _Mypair(_One_then_variadic_args_t(), _Right.key_comp(), _One_then_variadic_args_t(), _Al) {
: _Mypair(_One_then_variadic_args_t{}, _Right.key_comp(), _One_then_variadic_args_t{}, _Al) {
if
_CONSTEXPR_IF(!_Alnode_traits::is_always_equal::value) {
if (_Getal() != _Right._Getal()) {
@ -969,7 +974,7 @@ private:
} else {
clear();
_Getcomp() = _Right._Getcomp();
_Copy(_Right, _Move_tag());
_Copy(_Right, _Move_tag{});
}
}
@ -1198,7 +1203,7 @@ private:
clear();
_Getcomp() = _Right._Getcomp();
_Pocca(_Getal(), _Right._Getal());
_Copy(_Right, _Copy_tag());
_Copy(_Right, _Copy_tag{});
}
void _Copy_assign(const _Tree& _Right, true_type) {
@ -1220,7 +1225,7 @@ private:
_Scary->_Myhead = _Newhead;
_Proxy._Bind(_Alproxy, _Scary);
_Getcomp() = _Right._Getcomp();
_Copy(_Right, _Copy_tag());
_Copy(_Right, _Copy_tag{});
}
}

Просмотреть файл

@ -1471,10 +1471,12 @@ constexpr void _Debug_order_set_unchecked(_InIt _First, _InIt _Last, _Pr&& _Pred
#else // ^^^ _HAS_IF_CONSTEXPR / !_HAS_IF_CONSTEXPR vvv
template <size_t _Value>
struct _Priority_tag : _Priority_tag<_Value - 1> { // priority tag for tag dispatch
explicit _Priority_tag() = default;
};
template <>
struct _Priority_tag<0> { // base case priority tag for tag dispatch
explicit _Priority_tag() = default;
};
template <class _InIt, class _Pr>
@ -2701,7 +2703,9 @@ namespace ranges {
// objects from this type to remove some typical object-ish behaviors which helps users avoid depending on their
// non-specified object-ness.
struct _Construct_tag {};
struct _Construct_tag {
explicit _Construct_tag() = default;
};
_Not_quite_object() = delete;
@ -4573,7 +4577,9 @@ struct _Lex_compare_check_element_types_helper<byte, byte, void> : true_type {
#endif // _HAS_STD_BYTE
template <class _Memcmp_pr>
struct _Lex_compare_optimize {}; // optimization tag for lexicographical_compare
struct _Lex_compare_optimize {
explicit _Lex_compare_optimize() = default;
}; // optimization tag for lexicographical_compare
template <class _Memcmp_pr, class _Obj1, class _Obj2, class _FTy>
using _Lex_compare_check_element_types = _Lex_compare_optimize<conditional_t<
@ -4581,23 +4587,21 @@ using _Lex_compare_check_element_types = _Lex_compare_optimize<conditional_t<
void>>; // checks the lex_compare element types for memcmp safety
template <class _InIt1, class _InIt2, class _Pr>
constexpr _Lex_compare_optimize<void> _Lex_compare_memcmp_classify(const _InIt1&, const _InIt2&, const _Pr&) {
constexpr auto _Lex_compare_memcmp_classify(const _InIt1&, const _InIt2&, const _Pr&) {
// return lex_compare optimization category for arbitrary iterators
return {};
return _Lex_compare_optimize<void>{};
}
template <class _Obj1, class _Obj2, class _FTy>
constexpr _Lex_compare_check_element_types<less<int>, _Obj1, _Obj2, _FTy> _Lex_compare_memcmp_classify(
_Obj1* const&, _Obj2* const&, const less<_FTy>&) {
constexpr auto _Lex_compare_memcmp_classify(_Obj1* const&, _Obj2* const&, const less<_FTy>&) {
// return lex_compare optimization category for pointer iterators and less<_FTy>
return {};
return _Lex_compare_check_element_types<less<int>, _Obj1, _Obj2, _FTy>{};
}
template <class _Obj1, class _Obj2, class _FTy>
constexpr _Lex_compare_check_element_types<greater<int>, _Obj1, _Obj2, _FTy> _Lex_compare_memcmp_classify(
_Obj1* const&, _Obj2* const&, const greater<_FTy>&) {
constexpr auto _Lex_compare_memcmp_classify(_Obj1* const&, _Obj2* const&, const greater<_FTy>&) {
// return lex_compare optimization category for pointer iterators and greater<_FTy>
return {};
return _Lex_compare_check_element_types<greater<int>, _Obj1, _Obj2, _FTy>{};
}
template <class _InIt1, class _InIt2, class _Pr>

Просмотреть файл

@ -8,7 +8,7 @@
_STD_BEGIN
namespace pmr {
static memory_resource* _Default_resource = nullptr;
static memory_resource* _Default_resource{nullptr};
extern "C" _CRT_SATELLITE_1 _Aligned_new_delete_resource_impl* __cdecl _Aligned_new_delete_resource() noexcept {
return &const_cast<_Aligned_new_delete_resource_impl&>(

Просмотреть файл

@ -8,7 +8,7 @@
_EXTERN_C_UNLESS_PURE
// coefficients
static const double p[] = {0.0000000001632881, 0.0000000250483893, 0.0000027557344615, 0.0001984126975233,
static constexpr double p[] = {0.0000000001632881, 0.0000000250483893, 0.0000027557344615, 0.0001984126975233,
0.0083333333334816, 0.1666666666666574, 1.0000000000000001};
static constexpr size_t NP = sizeof(p) / sizeof(p[0]) - 1;