summaryrefslogtreecommitdiff
path: root/training/utils/candidate_set.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-11-23 17:33:47 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-11-23 17:33:47 +0000
commit072c4bb1edde483b87b93bc6f4eec36fc8a21008 (patch)
tree6ceaa6ae1e08df9e523282740b14f4857236297c /training/utils/candidate_set.cc
parent7e90b8ea10904f9b83f4e77e14c7396a3e6f7d5d (diff)
parent9e80389b9763aa4f7f626ec71b561ccf6948d3ad (diff)
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'training/utils/candidate_set.cc')
-rw-r--r--training/utils/candidate_set.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/training/utils/candidate_set.cc b/training/utils/candidate_set.cc
index 087efec3..33dae9a3 100644
--- a/training/utils/candidate_set.cc
+++ b/training/utils/candidate_set.cc
@@ -1,6 +1,11 @@
#include "candidate_set.h"
-#include <tr1/unordered_set>
+#ifndef HAVE_OLD_CPP
+# include <unordered_set>
+#else
+# include <tr1/unordered_set>
+namespace std { using std::tr1::unordered_set; }
+#endif
#include <boost/functional/hash.hpp>
@@ -139,12 +144,12 @@ void CandidateSet::ReadFromFile(const string& file) {
void CandidateSet::Dedup() {
if(!SILENT) cerr << "Dedup in=" << cs.size();
- tr1::unordered_set<Candidate, CandidateHasher, CandidateCompare> u;
+ unordered_set<Candidate, CandidateHasher, CandidateCompare> u;
while(cs.size() > 0) {
u.insert(cs.back());
cs.pop_back();
}
- tr1::unordered_set<Candidate, CandidateHasher, CandidateCompare>::iterator it = u.begin();
+ unordered_set<Candidate, CandidateHasher, CandidateCompare>::iterator it = u.begin();
while (it != u.end()) {
cs.push_back(*it);
it = u.erase(it);