Skip to content

Commit

Permalink
gne
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Jan 17, 2024
1 parent 732aadf commit c0fbd42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions glm/detail/_swizzle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace detail
struct _swizzle_base0
{
protected:
GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast<T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T& elem(int i){ return (reinterpret_cast<T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T const& elem(int i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }

// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
// The size 1 buffer is assumed to aligned to the actual members so that the
Expand Down Expand Up @@ -115,12 +115,12 @@ namespace detail

GLM_FUNC_QUALIFIER T& operator[](size_t i)
{
const std::size_t offset_dst[4] = { E0, E1, E2, E3 };
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
}
GLM_FUNC_QUALIFIER T operator[](size_t i) const
{
const std::size_t offset_dst[4] = { E0, E1, E2, E3 };
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
}

Expand Down

0 comments on commit c0fbd42

Please sign in to comment.