summaryrefslogtreecommitdiff
path: root/training/utils/candidate_set.cc
diff options
context:
space:
mode:
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..1dec9609 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>
+#ifdef HAVE_CXX11
+# 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);