This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: swap does not compile
Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| 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.
That was not the intention with the snippet anyway. Only to point at a
problem.
| | 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.
Will do. I'll test a little bit more first.
--
Lgb