summaryrefslogtreecommitdiff
path: root/lib/glAllocator.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-03-26 20:41:55 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-03-26 20:41:55 +0000
commit4f1da1644afc4a8a6569b484663aaa856b2678af (patch)
tree7e03c8f4bfc2497ad5d8bc52996f5dba3359dd6a /lib/glAllocator.h
parentglAllocator revamp (diff)
downloadilt-4f1da1644afc4a8a6569b484663aaa856b2678af.tar.bz2
ilt-4f1da1644afc4a8a6569b484663aaa856b2678af.tar.xz
ilt-4f1da1644afc4a8a6569b484663aaa856b2678af.zip
Fix warnings in glAllocator.h
Missing #pragma once in particular.
Diffstat (limited to 'lib/glAllocator.h')
-rw-r--r--lib/glAllocator.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/glAllocator.h b/lib/glAllocator.h
index 02690c3..b592ecb 100644
--- a/lib/glAllocator.h
+++ b/lib/glAllocator.h
@@ -1,3 +1,5 @@
+#pragma once
+
#include "special_members.h"
#include <glad/gl.h>
#include <iterator>
@@ -13,6 +15,8 @@ namespace Detail {
{
}
+ ~glPointer() noexcept = default;
+
DEFAULT_MOVE_COPY(glPointer);
constexpr glPointer() : ptr {nullptr}, name {0} { }
@@ -65,6 +69,7 @@ namespace Detail {
glPointer<T> &
operator++() noexcept
{
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
++ptr;
return *this;
}
@@ -72,6 +77,7 @@ namespace Detail {
glPointer<T> &
operator--() noexcept
{
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
--ptr;
return *this;
}
@@ -120,6 +126,7 @@ namespace Detail {
using pointer = glPointer<T>;
using const_pointer = glPointer<const T>;
using value_type = T;
+ using is_always_equal = std::true_type;
// NOLINTEND(readability-identifier-naming)
@@ -144,20 +151,19 @@ namespace Detail {
{
deallocateBuffer(ptr.bufferName());
}
-
- using is_always_equal = std::true_type;
};
}
template<typename T> struct std::iterator_traits<Detail::glPointer<T>> {
+ // NOLINTBEGIN(readability-identifier-naming) - STL like
using iterator_category = std::random_access_iterator_tag;
using iterator_concept = std::contiguous_iterator_tag;
using value_type = T;
using difference_type = std::ptrdiff_t;
using reference = T &;
using pointer = T *;
+ // NOLINTEND(readability-identifier-naming) - STL like
};
template<typename T>
-// NOLINTNEXTLINE(readability-identifier-naming) - OpenGL like
using glVector = std::vector<T, typename std::allocator_traits<Detail::glAllocator<T>>::allocator_type>;