swap()函数是如何被引入的?
#include <iostream>
using namespace std;
int main()
{
int a = 3;
int b = -5;
swap(a, b);
cout << a << " " << b << endl;
return 0;
}
===================
swap()函数应该是在头文件algorithm中的,
但上面代码中并没有引入此文件,
所以肯定是iostream的功劳,
但粗略地查看istream和ostream后,并没有找到algorithm
就来偷懒问大家啦。。。。