From 8cce88f8706ca6fb52592458aa12641c43469a6e Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Wed, 16 May 2018 03:27:07 +0200 Subject: c++98 support for bank map --- src/adlmidi_bankmap.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/adlmidi_bankmap.h') diff --git a/src/adlmidi_bankmap.h b/src/adlmidi_bankmap.h index 123c8e1..c249b55 100644 --- a/src/adlmidi_bankmap.h +++ b/src/adlmidi_bankmap.h @@ -25,9 +25,8 @@ #define ADLMIDI_BANKMAP_H #include -#include #include -#include +#include #include "adlmidi_ptr.hpp" @@ -79,15 +78,15 @@ public: class iterator { public: - iterator() {} + iterator(); value_type &operator*() const { return slot->value; } value_type *operator->() const { return &slot->value; } iterator &operator++(); bool operator==(const iterator &o) const; bool operator!=(const iterator &o) const; private: - Slot **buckets = nullptr, *slot = nullptr; - size_t index = 0; + Slot **buckets, *slot; + size_t index; iterator(Slot **buckets, Slot *slot, size_t index); #ifdef _MSC_VER template @@ -99,14 +98,15 @@ public: private: struct Slot { - Slot *next = nullptr, *prev = nullptr; + Slot *next, *prev; value_type value; + Slot() : next(NULL), prev(NULL) {} }; - std::unique_ptr m_buckets; - std::list> m_allocations; - Slot *m_freeslots = nullptr; - size_t m_size = 0; - size_t m_capacity = 0; + AdlMIDI_SPtrArray m_buckets; + std::list< AdlMIDI_SPtrArray > m_allocations; + Slot *m_freeslots; + size_t m_size; + size_t m_capacity; static size_t hash(key_type key); Slot *allocate_slot(); Slot *ensure_allocate_slot(); -- cgit v1.2.3