-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvector_factory.cpp
More file actions
34 lines (29 loc) · 816 Bytes
/
vector_factory.cpp
File metadata and controls
34 lines (29 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//*****************************************************************************
//
// Author: Michael Price
// License: Attribution-NonCommercial-NoDerivs 3.0 Unported
// http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode
//
//*****************************************************************************
#include <vector>
#include <map>
#include <string>
using namespace std;
typedef vector<map<string, string>> Dictionaries;
// Before move construction...
// returning vectors was EXPENSIVE!!!
//
void getDictionaries (Dictionaries & d)
{
/* populate d */
return;
}
// But now, we can use the natural
// syntax with minimal performance impact
//
Dictionaries getDictionaries ()
{
vector<map<string, string>> dictionaries;
/* populate dictionaries */
return dictionaries;
}