From 48e126214be012cef7ad356799602ef5169568cb Mon Sep 17 00:00:00 2001 From: Brett Date: Sun, 5 Mar 2023 12:00:45 -0500 Subject: [PATCH] update queues for better stl complience --- include/blt/std/queue.h | 32 ++++++++++++++++---------------- include/blt/std/random.h | 10 ++++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/include/blt/std/queue.h b/include/blt/std/queue.h index 49e32f2..69c2734 100644 --- a/include/blt/std/queue.h +++ b/include/blt/std/queue.h @@ -56,16 +56,16 @@ namespace blt { } void pop() { - if (isEmpty()) + if (empty()) return; m_insertIndex--; } - - bool isEmpty() { + + [[nodiscard]] inline bool empty() const { return m_insertIndex <= 0; } - - int size() { + + [[nodiscard]] inline int size() const { return m_insertIndex; } @@ -106,8 +106,8 @@ namespace blt { flat_queue(): m_data(new T[m_size]) { } - - void push(const T& t) { + + inline void push(const T& t) { if (m_insertIndex+1 >= m_size) { expand(); } @@ -121,26 +121,26 @@ namespace blt { [[nodiscard]] const T& front() const { return m_data[m_headIndex]; } - - void pop() { - if (isEmpty()) + + inline void pop() { + if (empty()) return; m_headIndex++; } - bool isEmpty() { + [[nodiscard]] inline bool empty() const { return m_headIndex >= m_size; } - int size() { + [[nodiscard]] inline int size() const { return m_insertIndex - m_headIndex; } - - T* begin(){ + + inline T* begin(){ return m_data[m_headIndex]; } - - T* end(){ + + inline T* end(){ return m_data[m_insertIndex]; } diff --git a/include/blt/std/random.h b/include/blt/std/random.h index 4cd5f27..86ca8fd 100644 --- a/include/blt/std/random.h +++ b/include/blt/std/random.h @@ -42,6 +42,16 @@ namespace blt { delete distribution; } }; + + template + class simplex_noise { + private: + + public: + simplex_noise() { + + } + }; } #endif //BLT_RANDOM_H