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

#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;
}

  

posted @ 2018-10-29 10:54  那一剑的風情  阅读(1593)  评论(0)    收藏  举报