vector、map作为函数入参时,赋默认值

时间:2022-10-17 09:50:24
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;

void testMap(const vector<int> &vTmp = vector<int>(), const map<string, double> &mapParam = map<string, double>())
{
    cout << "test end" << endl;
}

int main()
{
    testMap();

	getchar();
	return 0;
}