This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: swap does not compile
larsbj@gullik.net (Lars Gullik Bjønnes) writes:
| | | g++ -o swap swap.C
| | | swap.C: In function `int main()':
| | | swap.C:14: error: no matching function for call to `swap(size_t&, size_t&)'
| >
| | Your program is in error. The general std::swap is not supposed to be
| | found in <vector>. #include <algorithm>
|
| libstdc++ includes stl_algobase.h from vector.
That does not make your programe correct.
| including <algorithm> makes no difference. (I just left it out to make
| the testcase smaller.)
That is interesting.
| OTOH if I remove <vector> then it compiles just fine.
Huh. Please fill a proper PR -- I can't reproduce your failure.
-- Gaby