mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Use std::unordered_{map,set} (C++11) instead of boost::unordered_{map,set}
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
#include <unordered_set>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
namespace memusage
|
||||
{
|
||||
@@ -148,8 +146,6 @@ static inline size_t DynamicUsage(const std::shared_ptr<X>& p)
|
||||
return p ? MallocUsage(sizeof(X)) + MallocUsage(sizeof(stl_shared_counter)) : 0;
|
||||
}
|
||||
|
||||
// Boost data structures
|
||||
|
||||
template<typename X>
|
||||
struct unordered_node : private X
|
||||
{
|
||||
@@ -157,18 +153,6 @@ private:
|
||||
void* ptr;
|
||||
};
|
||||
|
||||
template<typename X, typename Y>
|
||||
static inline size_t DynamicUsage(const boost::unordered_set<X, Y>& s)
|
||||
{
|
||||
return MallocUsage(sizeof(unordered_node<X>)) * s.size() + MallocUsage(sizeof(void*) * s.bucket_count());
|
||||
}
|
||||
|
||||
template<typename X, typename Y, typename Z>
|
||||
static inline size_t DynamicUsage(const boost::unordered_map<X, Y, Z>& m)
|
||||
{
|
||||
return MallocUsage(sizeof(unordered_node<std::pair<const X, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count());
|
||||
}
|
||||
|
||||
template<typename X, typename Y>
|
||||
static inline size_t DynamicUsage(const std::unordered_set<X, Y>& s)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user