Skip to content

Commit da00c98

Browse files
jensmaurertkoeppe
authored andcommitted
[lib] Ensure non-member swap is declared in the header synopsis only
1 parent 82821f2 commit da00c98

File tree

3 files changed

+39
-124
lines changed

3 files changed

+39
-124
lines changed

source/containers.tex

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,11 +3767,6 @@
37673767
template<class InputIterator, class Allocator = allocator<@\placeholder{iter-value-type}@<InputIterator>>>
37683768
deque(InputIterator, InputIterator, Allocator = Allocator())
37693769
-> deque<@\placeholder{iter-value-type}@<InputIterator>, Allocator>;
3770-
3771-
// swap
3772-
template<class T, class Allocator>
3773-
void swap(deque<T, Allocator>& x, deque<T, Allocator>& y)
3774-
noexcept(noexcept(x.swap(y)));
37753770
}
37763771
\end{codeblock}
37773772

@@ -4207,11 +4202,6 @@
42074202
template<class InputIterator, class Allocator = allocator<@\placeholder{iter-value-type}@<InputIterator>>>
42084203
forward_list(InputIterator, InputIterator, Allocator = Allocator())
42094204
-> forward_list<@\placeholder{iter-value-type}@<InputIterator>, Allocator>;
4210-
4211-
// swap
4212-
template<class T, class Allocator>
4213-
void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
4214-
noexcept(noexcept(x.swap(y)));
42154205
}
42164206
\end{codeblock}
42174207

@@ -5004,11 +4994,6 @@
50044994
template<class InputIterator, class Allocator = allocator<@\placeholder{iter-value-type}@<InputIterator>>>
50054995
list(InputIterator, InputIterator, Allocator = Allocator())
50064996
-> list<@\placeholder{iter-value-type}@<InputIterator>, Allocator>;
5007-
5008-
// swap
5009-
template<class T, class Allocator>
5010-
void swap(list<T, Allocator>& x, list<T, Allocator>& y)
5011-
noexcept(noexcept(x.swap(y)));
50124997
}
50134998
\end{codeblock}
50144999

@@ -5697,11 +5682,6 @@
56975682
template<class InputIterator, class Allocator = allocator<@\placeholder{iter-value-type}@<InputIterator>>>
56985683
vector(InputIterator, InputIterator, Allocator = Allocator())
56995684
-> vector<@\placeholder{iter-value-type}@<InputIterator>, Allocator>;
5700-
5701-
// swap
5702-
template<class T, class Allocator>
5703-
constexpr void swap(vector<T, Allocator>& x, vector<T, Allocator>& y)
5704-
noexcept(noexcept(x.swap(y)));
57055685
}
57065686
\end{codeblock}%
57075687
\indexlibrarymember{vector}{operator==}%
@@ -6684,12 +6664,6 @@
66846664

66856665
template<class Key, class T, class Allocator>
66866666
map(initializer_list<pair<Key, T>>, Allocator) -> map<Key, T, less<Key>, Allocator>;
6687-
6688-
// swap
6689-
template<class Key, class T, class Compare, class Allocator>
6690-
void swap(map<Key, T, Compare, Allocator>& x,
6691-
map<Key, T, Compare, Allocator>& y)
6692-
noexcept(noexcept(x.swap(y)));
66936667
}
66946668
\end{codeblock}
66956669

@@ -7214,12 +7188,6 @@
72147188
template<class Key, class T, class Allocator>
72157189
multimap(initializer_list<pair<Key, T>>, Allocator)
72167190
-> multimap<Key, T, less<Key>, Allocator>;
7217-
7218-
// swap
7219-
template<class Key, class T, class Compare, class Allocator>
7220-
void swap(multimap<Key, T, Compare, Allocator>& x,
7221-
multimap<Key, T, Compare, Allocator>& y)
7222-
noexcept(noexcept(x.swap(y)));
72237191
}
72247192
\end{codeblock}%
72257193
\indexlibrarymember{multimap}{operator==}%
@@ -7519,12 +7487,6 @@
75197487

75207488
template<class Key, class Allocator>
75217489
set(initializer_list<Key>, Allocator) -> set<Key, less<Key>, Allocator>;
7522-
7523-
// swap
7524-
template<class Key, class Compare, class Allocator>
7525-
void swap(set<Key, Compare, Allocator>& x,
7526-
set<Key, Compare, Allocator>& y)
7527-
noexcept(noexcept(x.swap(y)));
75287490
}
75297491
\end{codeblock}%
75307492
\indexlibrarymember{set}{operator==}%
@@ -7799,12 +7761,6 @@
77997761

78007762
template<class Key, class Allocator>
78017763
multiset(initializer_list<Key>, Allocator) -> multiset<Key, less<Key>, Allocator>;
7802-
7803-
// swap
7804-
template<class Key, class Compare, class Allocator>
7805-
void swap(multiset<Key, Compare, Allocator>& x,
7806-
multiset<Key, Compare, Allocator>& y)
7807-
noexcept(noexcept(x.swap(y)));
78087764
}
78097765
\end{codeblock}%
78107766
\indexlibrarymember{multiset}{operator==}%
@@ -8297,12 +8253,6 @@
82978253
unordered_map(initializer_list<pair<Key, T>>, typename @\seebelow@::size_type, Hash,
82988254
Allocator)
82998255
-> unordered_map<Key, T, Hash, equal_to<Key>, Allocator>;
8300-
8301-
// swap
8302-
template<class Key, class T, class Hash, class Pred, class Alloc>
8303-
void swap(unordered_map<Key, T, Hash, Pred, Alloc>& x,
8304-
unordered_map<Key, T, Hash, Pred, Alloc>& y)
8305-
noexcept(noexcept(x.swap(y)));
83068256
}
83078257
\end{codeblock}
83088258

@@ -8876,12 +8826,6 @@
88768826
unordered_multimap(initializer_list<pair<Key, T>>, typename @\seebelow@::size_type,
88778827
Hash, Allocator)
88788828
-> unordered_multimap<Key, T, Hash, equal_to<Key>, Allocator>;
8879-
8880-
// swap
8881-
template<class Key, class T, class Hash, class Pred, class Alloc>
8882-
void swap(unordered_multimap<Key, T, Hash, Pred, Alloc>& x,
8883-
unordered_multimap<Key, T, Hash, Pred, Alloc>& y)
8884-
noexcept(noexcept(x.swap(y)));
88858829
}
88868830
\end{codeblock}
88878831

@@ -9235,12 +9179,6 @@
92359179
template<class T, class Hash, class Allocator>
92369180
unordered_set(initializer_list<T>, typename @\seebelow@::size_type, Hash, Allocator)
92379181
-> unordered_set<T, Hash, equal_to<T>, Allocator>;
9238-
9239-
// swap
9240-
template<class Key, class Hash, class Pred, class Alloc>
9241-
void swap(unordered_set<Key, Hash, Pred, Alloc>& x,
9242-
unordered_set<Key, Hash, Pred, Alloc>& y)
9243-
noexcept(noexcept(x.swap(y)));
92449182
}
92459183
\end{codeblock}
92469184

@@ -9566,12 +9504,6 @@
95669504
template<class T, class Hash, class Allocator>
95679505
unordered_multiset(initializer_list<T>, typename @\seebelow@::size_type, Hash, Allocator)
95689506
-> unordered_multiset<T, Hash, equal_to<T>, Allocator>;
9569-
9570-
// swap
9571-
template<class Key, class Hash, class Pred, class Alloc>
9572-
void swap(unordered_multiset<Key, Hash, Pred, Alloc>& x,
9573-
unordered_multiset<Key, Hash, Pred, Alloc>& y)
9574-
noexcept(noexcept(x.swap(y)));
95759507
}
95769508
\end{codeblock}
95779509

@@ -9839,9 +9771,6 @@
98399771
template<class Container, class Allocator>
98409772
queue(Container, Allocator) -> queue<typename Container::value_type, Container>;
98419773

9842-
template<class T, class Container>
9843-
void swap(queue<T, Container>& x, queue<T, Container>& y) noexcept(noexcept(x.swap(y)));
9844-
98459774
template<class T, class Container, class Alloc>
98469775
struct uses_allocator<queue<T, Container>, Alloc>
98479776
: uses_allocator<Container, Alloc>::type { };
@@ -10123,10 +10052,6 @@
1012310052

1012410053
// no equality is provided
1012510054

10126-
template<class T, class Container, class Compare>
10127-
void swap(priority_queue<T, Container, Compare>& x,
10128-
priority_queue<T, Container, Compare>& y) noexcept(noexcept(x.swap(y)));
10129-
1013010055
template<class T, class Container, class Compare, class Alloc>
1013110056
struct uses_allocator<priority_queue<T, Container, Compare>, Alloc>
1013210057
: uses_allocator<Container, Alloc>::type { };

source/iostreams.tex

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7471,25 +7471,43 @@
74717471
class Allocator = allocator<charT>>
74727472
class basic_stringbuf;
74737473

7474+
template<class charT, class traits, class Allocator>
7475+
void swap(basic_stringbuf<charT, traits, Allocator>& x,
7476+
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
7477+
74747478
using stringbuf = basic_stringbuf<char>;
74757479
using wstringbuf = basic_stringbuf<wchar_t>;
74767480

74777481
template<class charT, class traits = char_traits<charT>,
74787482
class Allocator = allocator<charT>>
74797483
class basic_istringstream;
74807484

7485+
template<class charT, class traits, class Allocator>
7486+
void swap(basic_istringstream<charT, traits, Allocator>& x,
7487+
basic_istringstream<charT, traits, Allocator>& y);
7488+
74817489
using istringstream = basic_istringstream<char>;
74827490
using wistringstream = basic_istringstream<wchar_t>;
74837491

74847492
template<class charT, class traits = char_traits<charT>,
74857493
class Allocator = allocator<charT>>
74867494
class basic_ostringstream;
7495+
7496+
template<class charT, class traits, class Allocator>
7497+
void swap(basic_ostringstream<charT, traits, Allocator>& x,
7498+
basic_ostringstream<charT, traits, Allocator>& y);
7499+
74877500
using ostringstream = basic_ostringstream<char>;
74887501
using wostringstream = basic_ostringstream<wchar_t>;
74897502

74907503
template<class charT, class traits = char_traits<charT>,
74917504
class Allocator = allocator<charT>>
74927505
class basic_stringstream;
7506+
7507+
template<class charT, class traits, class Allocator>
7508+
void swap(basic_stringstream<charT, traits, Allocator>& x,
7509+
basic_stringstream<charT, traits, Allocator>& y);
7510+
74937511
using stringstream = basic_stringstream<char>;
74947512
using wstringstream = basic_stringstream<wchar_t>;
74957513
}
@@ -7585,10 +7603,6 @@
75857603
basic_string<charT, traits, Allocator> buf; // \expos
75867604
void init_buf_ptrs(); // \expos
75877605
};
7588-
7589-
template<class charT, class traits, class Allocator>
7590-
void swap(basic_stringbuf<charT, traits, Allocator>& x,
7591-
basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
75927606
}
75937607
\end{codeblock}
75947608

@@ -8368,10 +8382,6 @@
83688382
private:
83698383
basic_stringbuf<charT, traits, Allocator> sb; // \expos
83708384
};
8371-
8372-
template<class charT, class traits, class Allocator>
8373-
void swap(basic_istringstream<charT, traits, Allocator>& x,
8374-
basic_istringstream<charT, traits, Allocator>& y);
83758385
}
83768386
\end{codeblock}
83778387

@@ -8687,10 +8697,6 @@
86878697
private:
86888698
basic_stringbuf<charT, traits, Allocator> sb; // \expos
86898699
};
8690-
8691-
template<class charT, class traits, class Allocator>
8692-
void swap(basic_ostringstream<charT, traits, Allocator>& x,
8693-
basic_ostringstream<charT, traits, Allocator>& y);
86948700
}
86958701
\end{codeblock}
86968702

@@ -9010,10 +9016,6 @@
90109016
private:
90119017
basic_stringbuf<charT, traits> sb; // \expos
90129018
};
9013-
9014-
template<class charT, class traits, class Allocator>
9015-
void swap(basic_stringstream<charT, traits, Allocator>& x,
9016-
basic_stringstream<charT, traits, Allocator>& y);
90179019
}
90189020
\end{codeblock}
90199021

@@ -9298,21 +9300,37 @@
92989300
namespace std {
92999301
template<class charT, class traits = char_traits<charT>>
93009302
class basic_filebuf;
9303+
9304+
template<class charT, class traits>
9305+
void swap(basic_filebuf<charT, traits>& x, basic_filebuf<charT, traits>& y);
9306+
93019307
using filebuf = basic_filebuf<char>;
93029308
using wfilebuf = basic_filebuf<wchar_t>;
93039309

93049310
template<class charT, class traits = char_traits<charT>>
93059311
class basic_ifstream;
9312+
9313+
template<class charT, class traits>
9314+
void swap(basic_ifstream<charT, traits>& x, basic_ifstream<charT, traits>& y);
9315+
93069316
using ifstream = basic_ifstream<char>;
93079317
using wifstream = basic_ifstream<wchar_t>;
93089318

93099319
template<class charT, class traits = char_traits<charT>>
93109320
class basic_ofstream;
9321+
9322+
template<class charT, class traits>
9323+
void swap(basic_ofstream<charT, traits>& x, basic_ofstream<charT, traits>& y);
9324+
93119325
using ofstream = basic_ofstream<char>;
93129326
using wofstream = basic_ofstream<wchar_t>;
93139327

93149328
template<class charT, class traits = char_traits<charT>>
93159329
class basic_fstream;
9330+
9331+
template<class charT, class traits>
9332+
void swap(basic_fstream<charT, traits>& x, basic_fstream<charT, traits>& y);
9333+
93169334
using fstream = basic_fstream<char>;
93179335
using wfstream = basic_fstream<wchar_t>;
93189336
}
@@ -9396,10 +9414,6 @@
93969414
int sync() override;
93979415
void imbue(const locale& loc) override;
93989416
};
9399-
9400-
template<class charT, class traits>
9401-
void swap(basic_filebuf<charT, traits>& x,
9402-
basic_filebuf<charT, traits>& y);
94039417
}
94049418
\end{codeblock}
94059419

@@ -10157,10 +10171,6 @@
1015710171
private:
1015810172
basic_filebuf<charT, traits> sb; // \expos
1015910173
};
10160-
10161-
template<class charT, class traits>
10162-
void swap(basic_ifstream<charT, traits>& x,
10163-
basic_ifstream<charT, traits>& y);
1016410174
}
1016510175
\end{codeblock}
1016610176

@@ -10392,10 +10402,6 @@
1039210402
private:
1039310403
basic_filebuf<charT, traits> sb; // \expos
1039410404
};
10395-
10396-
template<class charT, class traits>
10397-
void swap(basic_ofstream<charT, traits>& x,
10398-
basic_ofstream<charT, traits>& y);
1039910405
}
1040010406
\end{codeblock}
1040110407

@@ -10636,10 +10642,6 @@
1063610642
private:
1063710643
basic_filebuf<charT, traits> sb; // \expos
1063810644
};
10639-
10640-
template<class charT, class traits>
10641-
void swap(basic_fstream<charT, traits>& x,
10642-
basic_fstream<charT, traits>& y);
1064310645
}
1064410646
\end{codeblock}
1064510647

@@ -10850,6 +10852,11 @@
1085010852
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>
1085110853
class basic_syncbuf;
1085210854

10855+
// \ref{syncstream.syncbuf.special}, specialized algorithms
10856+
template<class charT, class traits, class Allocator>
10857+
void swap(basic_syncbuf<charT, traits, Allocator>&,
10858+
basic_syncbuf<charT, traits, Allocator>&);
10859+
1085310860
using syncbuf = basic_syncbuf<char>;
1085410861
using wsyncbuf = basic_syncbuf<wchar_t>;
1085510862

@@ -10911,11 +10918,6 @@
1091110918
streambuf_type* wrapped; // \expos
1091210919
bool emit_on_sync{}; // \expos
1091310920
};
10914-
10915-
// \ref{syncstream.syncbuf.special}, specialized algorithms
10916-
template<class charT, class traits, class Allocator>
10917-
void swap(basic_syncbuf<charT, traits, Allocator>&,
10918-
basic_syncbuf<charT, traits, Allocator>&);
1091910921
}
1092010922
\end{codeblock}
1092110923

0 commit comments

Comments
 (0)