Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove STL workarounds for VSO-1006185 #417

Merged
merged 6 commits into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions stl/inc/memory
Original file line number Diff line number Diff line change
Expand Up @@ -1839,12 +1839,9 @@ public:
enable_if_t<conjunction_v<is_reference<_Dx2>, is_constructible<_Dx2, remove_reference_t<_Dx2>>>, int> = 0>
unique_ptr(pointer, remove_reference_t<_Dx>&&) = delete;

#ifndef _M_CEE // TRANSITION, VSO-1006185
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,
enable_if_t<
Expand All @@ -1870,9 +1867,7 @@ public:
return *this;
}

#ifndef _M_CEE // TRANSITION, VSO-1006185
template <class _Dx2 = _Dx, enable_if_t<is_move_assignable_v<_Dx2>, int> = 0>
#endif // _M_CEE
unique_ptr& operator=(unique_ptr&& _Right) noexcept {
if (this != _STD addressof(_Right)) {
reset(_Right.release());
Expand Down Expand Up @@ -1972,16 +1967,11 @@ public:
enable_if_t<conjunction_v<is_reference<_Dx2>, is_constructible<_Dx2, remove_reference_t<_Dx2>>>, int> = 0>
unique_ptr(_Uty, remove_reference_t<_Dx>&&) = delete;

#ifndef _M_CEE // TRANSITION, VSO-1006185
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
template <class _Dx2 = _Dx, enable_if_t<is_move_assignable_v<_Dx2>, int> = 0>
#endif // _M_CEE
unique_ptr& operator=(unique_ptr&& _Right) noexcept {
if (this != _STD addressof(_Right)) {
reset(_Right.release());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,11 @@ namespace lwg_2905 {
STATIC_ASSERT(!is_constructible_v<unique_ptr<T, D>, pointer, A>);
STATIC_ASSERT(!is_constructible_v<unique_ptr<T[], D>, pointer, A>);

#ifndef _M_CEE // TRANSITION, VSO-1006185
// per LWG-2899
STATIC_ASSERT(!is_move_constructible_v<unique_ptr<T, D>>);
STATIC_ASSERT(!is_move_constructible_v<unique_ptr<T[], D>>);
STATIC_ASSERT(!is_move_assignable_v<unique_ptr<T, D>>);
STATIC_ASSERT(!is_move_assignable_v<unique_ptr<T[], D>>);
#endif // _M_CEE
}
{
using A = Immobile;
Expand All @@ -150,13 +148,11 @@ namespace lwg_2905 {
STATIC_ASSERT(!is_constructible_v<unique_ptr<T, D>, pointer, A>);
STATIC_ASSERT(!is_constructible_v<unique_ptr<T[], D>, pointer, A>);

#ifndef _M_CEE // TRANSITION, VSO-1006185
// per LWG-2899
STATIC_ASSERT(is_nothrow_move_constructible_v<unique_ptr<T, D>>);
STATIC_ASSERT(is_nothrow_move_constructible_v<unique_ptr<T[], D>>);
STATIC_ASSERT(!is_move_assignable_v<unique_ptr<T, D>>);
STATIC_ASSERT(!is_move_assignable_v<unique_ptr<T[], D>>);
#endif // _M_CEE
}
{
using A = Immobile;
Expand All @@ -166,13 +162,11 @@ namespace lwg_2905 {
STATIC_ASSERT(!is_constructible_v<unique_ptr<T, D>, pointer, const A>);
STATIC_ASSERT(!is_constructible_v<unique_ptr<T[], D>, pointer, const A>);

#ifndef _M_CEE // TRANSITION, VSO-1006185
// per LWG-2899
STATIC_ASSERT(is_nothrow_move_constructible_v<unique_ptr<T, D>>);
STATIC_ASSERT(is_nothrow_move_constructible_v<unique_ptr<T[], D>>);
STATIC_ASSERT(!is_move_assignable_v<unique_ptr<T, D>>);
STATIC_ASSERT(!is_move_assignable_v<unique_ptr<T[], D>>);
#endif // _M_CEE
}
}

Expand Down