Created
October 3, 2017 17:50
-
-
Save xquery/50dc6fb1c06193da69928d7b996480b8 to your computer and use it in GitHub Desktop.
ptable impl with mmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
using namespace std; | |
typedef multimap <string, tuple<int,int> > ptable; | |
int main() { | |
string orig = "a large span of text"; | |
string add = "english"; | |
ptable pt; | |
pt.insert(make_pair("orig",make_tuple(0,2))); | |
pt.insert(make_pair("orig",make_tuple(8,8))); | |
pt.insert(make_pair("add",make_tuple(0,8))); | |
pt.insert(make_pair("orig",make_tuple(16,4))); | |
for (ptable::iterator it = pt.begin(); it != pt.end(); ++it) | |
{ | |
cout << it->first << "=(" << get<0>(it->second) << "," << get<1>(it->second) << ")" << endl; | |
} | |
cout<< pt.size() << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
emits
add=(0,8)
orig=(0,2)
orig=(8,8)
orig=(16,4)
4