- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493

This commit is contained in:
Christophe Riccio 2016-05-05 14:13:21 +02:00
parent 33bc27ddc4
commit d52766297d
4 changed files with 10 additions and 6 deletions

View File

@ -723,11 +723,15 @@
# define GLM_DEFAULT_CTOR
#endif
#if GLM_HAS_CONSTEXPR
#if GLM_HAS_CONSTEXPR_PARTIAL
# define GLM_CONSTEXPR constexpr
# define GLM_RELAXED_CONSTEXPR constexpr
#else
# define GLM_CONSTEXPR
#endif
#if GLM_HAS_CONSTEXPR
# define GLM_RELAXED_CONSTEXPR constexpr
#else
# define GLM_RELAXED_CONSTEXPR const
#endif

View File

@ -61,7 +61,7 @@ namespace glm
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x3(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tmat4x3(ctor);
GLM_FUNC_DECL explicit tmat4x3(T const & x);
GLM_FUNC_DECL tmat4x3(
T const & x0, T const & y0, T const & z0,

View File

@ -75,7 +75,7 @@ namespace detail
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0), w(1)
# endif

View File

@ -61,7 +61,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat()
# ifndef GLM_FORCE_NO_CTOR_INIT
: real(tquat<T, P>())
, dual(tquat<T, P>(0, 0, 0, 0))
@ -71,7 +71,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
: real(d.real)
, dual(d.dual)
{}