Only a few years later, but I wanted to share my decision. I need a comparator function for std :: map and std :: set.
After messing around a bit, I found a solution to have the following code
#ifndef __UTIL_GLM__ #define __UTIL_GLM__ #include "glm/vec2.hpp" namespace glm{ template <typename T, precision P> bool operator<(const tvec2<T, P>& a,const tvec2<T, P>& b) { return (ax < bx || (ax == bx && ay < by)); } }; #endif
in the util_glm.hpp header file and include it where a comparator with
#include "util_glm.hpp"
I am sure that a similar solution can be performed for glm :: ivec3
source share