Changeset View
Changeset View
Standalone View
Standalone View
src/limitedmap.h
// Copyright (c) 2012-2016 The Bitcoin Core developers | // Copyright (c) 2012-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_LIMITEDMAP_H | #ifndef BITCOIN_LIMITEDMAP_H | ||||
#define BITCOIN_LIMITEDMAP_H | #define BITCOIN_LIMITEDMAP_H | ||||
#include <assert.h> | #include <cassert> | ||||
#include <map> | #include <map> | ||||
/** | /** | ||||
* STL-like map container that only keeps the N elements with the highest value. | * STL-like map container that only keeps the N elements with the highest value. | ||||
*/ | */ | ||||
template <typename K, typename V> class limitedmap { | template <typename K, typename V> class limitedmap { | ||||
public: | public: | ||||
typedef K key_type; | typedef K key_type; | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |