util: switch from Boost to std::unordered set/map

This commit replaces the ue2::unordered_{set,map} types with their STL
versions, with some new hashing utilities in util/hash.h. The new types
ue2_unordered_set<T> and ue2_unordered_map<Key, T> default to using the
ue2_hasher.

The header util/ue2_containers.h has been removed, and the flat_set/map
containers moved to util/flat_containers.h.
This commit is contained in:
Justin Viiret
2017-07-14 14:59:52 +10:00
committed by Matthew Barr
parent a425bb9b7c
commit 9cf66b6ac9
123 changed files with 1048 additions and 772 deletions

View File

@@ -42,7 +42,6 @@
#include "util/container.h"
#include "util/graph_range.h"
#include "util/make_unique.h"
#include "util/ue2_containers.h"
#include "util/ue2string.h"
#include "util/unicode_def.h"
#include "util/unicode_set.h"
@@ -52,6 +51,7 @@
#include <memory>
#include <set>
#include <sstream>
#include <unordered_set>
#include <vector>
#include <boost/utility.hpp>
@@ -143,7 +143,7 @@ void findPaths(const NGHolder &g, CorpusProperties &cProps,
vector<unique_ptr<VertexPath>> open;
open.push_back(ue2::make_unique<VertexPath>(1, g.start));
ue2::unordered_set<NFAVertex> one_way_in;
unordered_set<NFAVertex> one_way_in;
for (const auto &v : vertices_range(g)) {
if (in_degree(v, g) <= 1) {
one_way_in.insert(v);

View File

@@ -41,6 +41,7 @@
#include "util/compare.h"
#include "util/report.h"
#include "util/report_manager.h"
#include "util/unordered.h"
#include <algorithm>
@@ -770,7 +771,7 @@ struct EdgeCache {
}
private:
unordered_map<pair<NFAVertex, NFAVertex>, NFAEdge> cache;
ue2_unordered_map<pair<NFAVertex, NFAVertex>, NFAEdge> cache;
};
struct fmstate {