Skip to content
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
1 change: 1 addition & 0 deletions stl/inc/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ public:
}

#if _HAS_CXX23
template <int = 0> // see GH-3013
constexpr void swap(const tuple& _Right) const
noexcept(conjunction_v<is_nothrow_swappable<const _This>, is_nothrow_swappable<const _Rest>...>) {
_Swap_adl(_Myfirst._Val, _Right._Myfirst._Val);
Expand Down
1 change: 1 addition & 0 deletions stl/inc/utility
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ struct pair { // store a pair of values
}

#if _HAS_CXX23
template <int = 0> // see GH-3013
constexpr void swap(const pair& _Right) const
noexcept(is_nothrow_swappable_v<const _Ty1>&& is_nothrow_swappable_v<const _Ty2>) {
if (this != _STD addressof(_Right)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if _HAS_CXX20
Expand Down Expand Up @@ -50,3 +52,7 @@ struct __declspec(dllexport) ExportedStack : stack<int> {};
struct __declspec(dllexport) ExportedSpan : span<int> {};
struct __declspec(dllexport) ExportedSpanThree : span<int, 3> {};
#endif // _HAS_CXX20

// Test GH-3013 "<utility>: pair::swap(const pair&) interacts badly with __declspec(dllexport)"
struct __declspec(dllexport) ExportedPair : pair<int, int> {};
struct __declspec(dllexport) ExportedTuple : tuple<int, int, int> {};