update queues for better stl complience

v1
Brett 2023-03-05 12:00:45 -05:00
parent bd89abb2f3
commit 48e126214b
2 changed files with 26 additions and 16 deletions

View File

@ -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];
}

View File

@ -42,6 +42,16 @@ namespace blt {
delete distribution;
}
};
template<typename T>
class simplex_noise {
private:
public:
simplex_noise() {
}
};
}
#endif //BLT_RANDOM_H