length() member functions are constexpr #657

This commit is contained in:
Christophe Riccio 2017-07-24 12:01:44 +02:00
parent 50a527c97d
commit 1b78e2b681
16 changed files with 73 additions and 72 deletions

View File

@ -24,6 +24,14 @@ namespace glm
col_type value[2];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -66,14 +74,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 2;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const & v) GLM_DEFAULT;

View File

@ -25,6 +25,14 @@ namespace glm
col_type value[2];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -67,14 +75,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 2;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, T, P> const & m) GLM_DEFAULT;

View File

@ -25,6 +25,14 @@ namespace glm
col_type value[2];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -69,14 +77,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 2;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, T, P> const & m) GLM_DEFAULT;

View File

@ -25,6 +25,14 @@ namespace glm
col_type value[3];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -74,14 +82,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 3;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, T, P> const & m) GLM_DEFAULT;

View File

@ -24,6 +24,14 @@ namespace glm
col_type value[3];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -73,14 +81,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 3;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, T, P> const & m) GLM_DEFAULT;

View File

@ -25,6 +25,14 @@ namespace glm
col_type value[3];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -74,14 +82,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 3;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, T, P> const & m) GLM_DEFAULT;

View File

@ -25,6 +25,14 @@ namespace glm
col_type value[4];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -79,14 +87,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 4;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, T, P> const & m) GLM_DEFAULT;

View File

@ -25,6 +25,14 @@ namespace glm
col_type value[4];
public:
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; }
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
@ -79,14 +87,6 @@ namespace glm
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 4;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Unary arithmetic operators --
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, T, P> const & m) GLM_DEFAULT;

View File

@ -27,7 +27,7 @@ namespace glm
// -- Accesses --
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 4;}
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;

View File

@ -78,7 +78,7 @@ namespace glm
/// Return the count of components of the vector
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 1;}
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;}
GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const & operator[](length_type i) const;

View File

@ -79,7 +79,7 @@ namespace glm
/// Return the count of components of the vector
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 2;}
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;}
GLM_FUNC_DECL T& operator[](length_type i);
GLM_FUNC_DECL T const& operator[](length_type i) const;

View File

@ -79,7 +79,7 @@ namespace glm
/// Return the count of components of the vector
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 3;}
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;}
GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const & operator[](length_type i) const;

View File

@ -82,7 +82,7 @@ namespace glm
/// Return the count of components of the vector
typedef length_t length_type;
GLM_FUNC_DECL static length_type length(){return 4;}
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const & operator[](length_type i) const;

View File

@ -70,7 +70,7 @@ namespace glm
typedef length_t length_type;
/// Return the count of components of a quaternion
GLM_FUNC_DECL static length_type length(){return 4;}
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const & operator[](length_type i) const;

View File

@ -49,7 +49,7 @@ namespace glm
typedef length_t length_type;
/// Return the count of components of a dual quaternion
GLM_FUNC_DECL static length_type length(){return 2;}
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;}
GLM_FUNC_DECL part_type & operator[](length_type i);
GLM_FUNC_DECL part_type const & operator[](length_type i) const;

View File

@ -74,7 +74,8 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Removed GCC shadow warnings #595
- Added error for including of different versions of GLM #619
- Added GLM_FORCE_IGNORE_VERSION to ignore error caused by including different version of GLM #619
- Reduced warnings when using very strict compilation flags #646
- Reduced warnings when using very strict compilation flags #646
- length() member functions are constexpr #657
#### Fixes:
- Removed doxygen references to GTC_half_float which was removed in 0.9.4