diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/glAllocator.h | 12 |
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>; |
