Added move contructors and assignment operators (#141)

This commit is contained in:
Christophe Riccio 2014-01-14 22:51:04 +01:00
parent 66efbcc597
commit d3b8b2b64e
20 changed files with 394 additions and 156 deletions

View file

@ -527,6 +527,25 @@
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
__has_feature(cxx_unrestricted_unions))
// N2346
#define GLM_HAS_DEFAULTED_FUNCTIONS ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12))) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \
__has_feature(cxx_defaulted_functions))
// N2118
#define GLM_HAS_RVALUE_REFERENCES ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11))) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
__has_feature(cxx_rvalue_references))
#define GLM_HAS_STL_ARRAY ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC10))) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)))
// OpenMP
#ifdef _OPENMP
# if(GLM_COMPILER & GLM_COMPILER_GCC)

View file

@ -33,6 +33,14 @@
#include "type_vec2.hpp"
#include "type_mat.hpp"
#include <limits>
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -79,12 +87,20 @@ namespace detail
col_type const & v1,
col_type const & v2);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat2x2(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat2x2(std::initializer_list<U> l);
GLM_FUNC_DECL tmat2x2(std::initializer_list<tvec2<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat2x2(std::initializer_list<tvec2<T, P> > l);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -119,6 +135,15 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
@ -148,9 +173,6 @@ namespace detail
GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
};
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> compute_inverse_mat2(tmat2x2<T, P> const & m);
// Binary operators
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+ (

View file

@ -30,31 +30,20 @@ namespace glm{
namespace detail
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x2<T, P>::length() const
{
return 2;
}
GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tmat2x2<T, P>::length() const {return 2;}
//////////////////////////////////////
// Accesses
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type &
tmat2x2<T, P>::operator[]
(
length_t i
)
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](length_t i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const &
tmat2x2<T, P>::operator[]
(
length_t i
) const
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](length_t i) const
{
assert(i < this->length());
return this->value[i];

View file

@ -33,7 +33,14 @@
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_mat.hpp"
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -73,12 +80,20 @@ namespace detail
col_type const & v0,
col_type const & v1);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat2x3(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat2x3(std::initializer_list<U> m);
GLM_FUNC_DECL tmat2x3(std::initializer_list<tvec3<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat2x3(std::initializer_list<tvec3<T, P> > m);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -111,6 +126,15 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator= (tmat2x3<U, P> const & m);

View file

@ -33,7 +33,14 @@
#include "type_vec2.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -73,12 +80,20 @@ namespace detail
col_type const & v0,
col_type const & v1);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat2x4(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat2x4(std::initializer_list<U> m);
GLM_FUNC_DECL tmat2x4(std::initializer_list<tvec4<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat2x4(std::initializer_list<tvec4<T, P> > m);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -113,6 +128,15 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P>& operator= (tmat2x4<U, P> const & m);

View file

@ -33,7 +33,14 @@
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "type_mat.hpp"
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -75,12 +82,21 @@ namespace detail
col_type const & v1,
col_type const & v2);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat3x2(std::initializer_list<U> l);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat3x2(std::initializer_list<U> l);
GLM_FUNC_DECL tmat3x2(std::initializer_list<tvec2<T, P> > l);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat3x2(std::initializer_list<tvec2<T, P> > l);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -117,6 +133,16 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<U, P> const & m);

View file

@ -32,7 +32,14 @@
#include "../fwd.hpp"
#include "type_vec3.hpp"
#include "type_mat.hpp"
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -80,12 +87,21 @@ namespace detail
col_type const & v1,
col_type const & v2);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat3x3(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat3x3(std::initializer_list<U> m);
GLM_FUNC_DECL tmat3x3(std::initializer_list<tvec3<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat3x3(std::initializer_list<tvec3<T, P> > m);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -122,6 +138,16 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<U, P> const & m);

View file

@ -33,7 +33,14 @@
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -75,12 +82,21 @@ namespace detail
col_type const & v1,
col_type const & v2);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat3x4(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat3x4(std::initializer_list<U> m);
GLM_FUNC_DECL tmat3x4(std::initializer_list<tvec4<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat3x4(std::initializer_list<tvec4<T, P> > m);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -117,6 +133,16 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat3x4<T, P> & operator= (tmat3x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator= (tmat3x4<U, P> const & m);

View file

@ -33,7 +33,14 @@
#include "type_vec2.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -77,12 +84,22 @@ namespace detail
col_type const & v2,
col_type const & v3);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat4x2(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat4x2(std::initializer_list<U> m);
GLM_FUNC_DECL tmat4x2(std::initializer_list<tvec2<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat4x2(std::initializer_list<tvec2<T, P> > m);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
this->value[3] = std::move(m.value[3]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -123,6 +140,17 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
this->value[3] = std::move(m.value[3]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x2<T, P>& operator= (tmat4x2<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P>& operator= (tmat4x2<U, P> const & m);

View file

@ -33,7 +33,14 @@
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
namespace glm{
namespace detail
@ -77,12 +84,22 @@ namespace detail
col_type const & v2,
col_type const & v3);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat4x3(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat4x3(std::initializer_list<U> m);
GLM_FUNC_DECL tmat4x3(std::initializer_list<tvec3<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat4x3(std::initializer_list<tvec3<T, P> > m);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
this->value[3] = std::move(m.value[3]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -123,6 +140,17 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](size_type i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
this->value[3] = std::move(m.value[3]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x3<T, P> & operator= (tmat4x3<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator= (tmat4x3<U, P> const & m);

View file

@ -32,9 +32,12 @@
#include "../fwd.hpp"
#include "type_vec4.hpp"
#include "type_mat.hpp"
#if(GLM_HAS_INITIALIZER_LISTS)
#if GLM_HAS_INITIALIZER_LISTS
# include <initializer_list>
#endif //GLM_HAS_INITIALIZER_LISTS
#endif
#if GLM_HAS_RVALUE_REFERENCES
# include <algorithm>
#endif
#include <limits>
#include <cstddef>
@ -85,12 +88,22 @@ namespace detail
col_type const & v2,
col_type const & v3);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat4x4(std::initializer_list<U> m);
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tmat4x4(std::initializer_list<U> m);
GLM_FUNC_DECL tmat4x4(std::initializer_list<tvec4<T, P> > m);
#endif//GLM_HAS_INITIALIZER_LISTS
GLM_FUNC_DECL tmat4x4(std::initializer_list<tvec4<T, P> > m);
# endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
this->value[3] = std::move(m.value[3]);
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
//////////////////////////////////////
// Conversions
@ -131,6 +144,17 @@ namespace detail
GLM_FUNC_DECL col_type const & operator[](length_t i) const;
// Unary updatable operators
# if(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> && m)
{
this->value[0] = std::move(m.value[0]);
this->value[1] = std::move(m.value[1]);
this->value[2] = std::move(m.value[2]);
this->value[3] = std::move(m.value[3]);
return *this;
}
# endif//(GLM_HAS_DEFAULTED_FUNCTIONS && GLM_HAS_RVALUE_REFERENCES)
GLM_FUNC_DECL tmat4x4<T, P> & operator= (tmat4x4<T, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator= (tmat4x4<U, P> const & m);

View file

@ -82,10 +82,10 @@ namespace detail
template <precision Q>
GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec1(std::initializer_list<U> const & v);
#endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec1(std::initializer_list<U> l);
# endif//GLM_HAS_INITIALIZER_LISTS
//////////////////////////////////////
// Explicit basic constructors
@ -115,9 +115,9 @@ namespace detail
// Unary arithmetic operators
GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator= (tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator+=(U const & s);
template <typename U>

View file

@ -74,10 +74,10 @@ namespace detail
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(std::initializer_list<U> const & v) :
x(static_cast<T>(v.begin()[0]))
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(std::initializer_list<U> l) :
x(static_cast<T>(l.begin()[0]))
{
assert(v.size() == this->length());
assert(l.size() == this->length());
}
#endif//GLM_HAS_INITIALIZER_LISTS

View file

@ -107,10 +107,10 @@ namespace detail
template <precision Q>
GLM_FUNC_DECL tvec2(tvec2<T, Q> const & v);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec2(std::initializer_list<U> const & v);
#endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec2(std::initializer_list<U> l);
# endif//GLM_HAS_INITIALIZER_LISTS
//////////////////////////////////////
// Explicit basic constructors
@ -127,11 +127,11 @@ namespace detail
// Swizzle constructors
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
template <int E0, int E1>
GLM_FUNC_DECL tvec2(_swizzle<2,T, P, tvec2<T, P>, E0, E1,-1,-2> const & that)
{
*this = that();
}
template <int E0, int E1>
GLM_FUNC_DECL tvec2(_swizzle<2,T, P, tvec2<T, P>, E0, E1,-1,-2> const & that)
{
*this = that();
}
# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
//////////////////////////////////////
@ -160,9 +160,9 @@ namespace detail
// Unary arithmetic operators
GLM_FUNC_DECL tvec2<T, P> & operator= (tvec2<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator= (tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator+=(U s);
template <typename U>

View file

@ -77,11 +77,11 @@ namespace detail
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(std::initializer_list<U> const & v) :
x(static_cast<T>(v.begin()[0])),
y(static_cast<T>(v.begin()[1]))
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(std::initializer_list<U> l) :
x(static_cast<T>(l.begin()[0])),
y(static_cast<T>(l.begin()[1]))
{
assert(v.size() == this->length());
assert(l.size() == this->length());
}
#endif//GLM_HAS_INITIALIZER_LISTS

View file

@ -108,10 +108,10 @@ namespace detail
template <precision Q>
GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec3(std::initializer_list<U> const & v);
#endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec3(std::initializer_list<U> l);
# endif//GLM_HAS_INITIALIZER_LISTS
//////////////////////////////////////
// Explicit basic constructors
@ -155,32 +155,32 @@ namespace detail
// Swizzle constructors
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec3(_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & that)
{
*this = that();
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec3(_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & that)
{
*this = that();
}
template <int E0, int E1>
GLM_FUNC_DECL tvec3(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & s)
{
*this = tvec3<T, P>(v(), s);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec3(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & s)
{
*this = tvec3<T, P>(v(), s);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec3(T const & s, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
{
*this = tvec3<T, P>(s, v());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec3(T const & s, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
{
*this = tvec3<T, P>(s, v());
}
# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator= (tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(U s);
template <typename U>

View file

@ -80,12 +80,12 @@ namespace detail
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(std::initializer_list<U> const & v) :
x(static_cast<T>(v.begin()[0])),
y(static_cast<T>(v.begin()[1])),
z(static_cast<T>(v.begin()[2]))
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(std::initializer_list<U> l) :
x(static_cast<T>(l.begin()[0])),
y(static_cast<T>(l.begin()[1])),
z(static_cast<T>(l.begin()[2]))
{
assert(v.size() == this->length());
assert(l.size() == this->length());
}
#endif//GLM_HAS_INITIALIZER_LISTS

View file

@ -147,10 +147,10 @@ namespace detail
template <precision Q>
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec4(std::initializer_list<U> l);
#endif//GLM_HAS_INITIALIZER_LISTS
# if(GLM_HAS_INITIALIZER_LISTS)
template <typename U>
GLM_FUNC_DECL tvec4(std::initializer_list<U> l);
# endif//GLM_HAS_INITIALIZER_LISTS
//////////////////////////////////////
// Explicit basic constructors
@ -205,53 +205,54 @@ namespace detail
// Swizzle constructors
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
template <int E0, int E1, int E2, int E3>
GLM_FUNC_DECL tvec4(_swizzle<4, T, P, tvec4<T, P>, E0, E1, E2, E3> const & that)
{
*this = that();
}
template <int E0, int E1, int E2, int E3>
GLM_FUNC_DECL tvec4(_swizzle<4, T, P, tvec4<T, P>, E0, E1, E2, E3> const & that)
{
*this = that();
}
template <int E0, int E1, int F0, int F1>
GLM_FUNC_DECL tvec4(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, _swizzle<2, T, P, tvec2<T, P>, F0, F1, -1, -2> const & u)
{
*this = tvec4<T, P>(v(), u());
}
template <int E0, int E1, int F0, int F1>
GLM_FUNC_DECL tvec4(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, _swizzle<2, T, P, tvec2<T, P>, F0, F1, -1, -2> const & u)
{
*this = tvec4<T, P>(v(), u());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, T const & y, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
{
*this = tvec4<T, P>(x, y, v());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, T const & y, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
{
*this = tvec4<T, P>(x, y, v());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & w)
{
*this = tvec4<T, P>(x, v(), w);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, _swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & w)
{
*this = tvec4<T, P>(x, v(), w);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & z, T const & w)
{
*this = tvec4<T, P>(v(), z, w);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & z, T const & w)
{
*this = tvec4<T, P>(v(), z, w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v, T const & w)
{
*this = tvec4<T, P>(v(), w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v, T const & w)
{
*this = tvec4<T, P>(v(), w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(T const & x, _swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v)
{
*this = tvec4<T, P>(x, v());
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(T const & x, _swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v)
{
*this = tvec4<T, P>(x, v());
}
# endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec4<T, P> & operator= (tvec4<T, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator+=(T s);
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec4<T, P> const & v);
GLM_FUNC_DECL tvec4<T, P> & operator-=(T s);

View file

@ -121,13 +121,13 @@ namespace detail
#if(GLM_HAS_INITIALIZER_LISTS)
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(std::initializer_list<U> v) :
x(static_cast<T>(v.begin()[0])),
y(static_cast<T>(v.begin()[1])),
z(static_cast<T>(v.begin()[2])),
w(static_cast<T>(v.begin()[3]))
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(std::initializer_list<U> l) :
x(static_cast<T>(l.begin()[0])),
y(static_cast<T>(l.begin()[1])),
z(static_cast<T>(l.begin()[2])),
w(static_cast<T>(l.begin()[3]))
{
assert(v.size() == this->length());
assert(l.size() == this->length());
}
#endif//GLM_HAS_INITIALIZER_LISTS

View file

@ -42,6 +42,7 @@ GLM 0.9.6.0: 2014-XX-XX
- Added transparent use of SIMD instructions for vec4 and mat4 types
- Removed degrees for function parameters
- Removed GLM_FORCE_RADIANS, active by default
- Added move contructors and assignment operators (#141)
================================================================================
GLM 0.9.5.2: 2014-0X-XX