Skip to content

Commit

Permalink
Fixed interactions with GLM_FORCE_NO_CTOR_INIT and default functions #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Groovounet committed Jul 25, 2015
1 parent 53e494b commit afa1937
Show file tree
Hide file tree
Showing 53 changed files with 535 additions and 320 deletions.
6 changes: 6 additions & 0 deletions glm/detail/setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,14 @@

#if GLM_HAS_DEFAULTED_FUNCTIONS
# define GLM_DEFAULT = default
# ifdef GLM_FORCE_NO_CTOR_INIT
# define GLM_DEFAULT_CTOR = default
# else
# define GLM_DEFAULT_CTOR
# endif
#else
# define GLM_DEFAULT
# define GLM_DEFAULT_CTOR
#endif

#if GLM_HAS_CONSTEXPR
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_mat2x2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace glm
//////////////////////////////////////
// Constructors

GLM_FUNC_DECL tmat2x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat2x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat2x2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace detail
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
{
Expand All @@ -62,7 +62,9 @@ namespace detail
this->value[1] = col_type(0, 1);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
{
Expand Down
3 changes: 2 additions & 1 deletion glm/detail/type_mat2x3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ namespace glm

public:
// Constructors
GLM_FUNC_DECL tmat2x3() GLM_DEFAULT;

GLM_FUNC_DECL tmat2x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat2x3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
{
Expand All @@ -44,7 +44,9 @@ namespace glm
this->value[1] = col_type(0, 1, 0);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
{
Expand Down
5 changes: 2 additions & 3 deletions glm/detail/type_mat2x4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ namespace glm
# endif//GLM_META_PROG_HELPERS

private:
/// @cond DETAIL
col_type value[2];
/// @endcond

public:
// Constructors
GLM_FUNC_DECL tmat2x4() GLM_DEFAULT;

GLM_FUNC_DECL tmat2x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat2x4.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
{
Expand All @@ -44,7 +44,9 @@ namespace glm
this->value[1] = col_type(0, 1, 0, 0);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
{
Expand Down
4 changes: 1 addition & 3 deletions glm/detail/type_mat3x2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ namespace glm
# endif//GLM_META_PROG_HELPERS

private:
/// @cond DETAIL
col_type value[3];
/// @endcond

public:
// Constructors

GLM_FUNC_DECL tmat3x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat3x2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
{
Expand All @@ -45,7 +45,9 @@ namespace glm
this->value[2] = col_type(0, 0);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
{
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_mat3x3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace glm
public:
// Constructors

GLM_FUNC_DECL tmat3x3() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat3x3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace detail
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
{
Expand All @@ -69,7 +69,9 @@ namespace detail
this->value[2] = col_type(0, 0, 1);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
{
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_mat3x4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace glm
public:
// Constructors

GLM_FUNC_DECL tmat3x4() GLM_DEFAULT;
GLM_FUNC_DECL tmat3x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat3x4.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
{
Expand All @@ -45,7 +45,9 @@ namespace glm
this->value[2] = col_type(0, 0, 1, 0);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
{
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_mat4x2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace glm
public:
// Constructors

GLM_FUNC_DECL tmat4x2() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat4x2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
{
Expand All @@ -46,7 +46,9 @@ namespace glm
this->value[3] = col_type(0, 0);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
{
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_mat4x3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace glm
public:
// Constructors

GLM_FUNC_DECL tmat4x3() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat4x3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace glm
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
{
Expand All @@ -46,7 +46,9 @@ namespace glm
this->value[3] = col_type(0, 0, 0);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
{
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_mat4x4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace glm

public:
// Constructors
GLM_FUNC_DECL tmat4x4() GLM_DEFAULT;
GLM_FUNC_DECL tmat4x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_mat4x4.inl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace detail
//////////////////////////////////////////////////////////////
// Constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
{
Expand All @@ -106,7 +106,9 @@ namespace detail
this->value[3] = col_type(0, 0, 0, 1);
# endif
}
# endif

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
{
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_vec1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

GLM_FUNC_DECL tvec1() GLM_DEFAULT;
GLM_FUNC_DECL tvec1() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec1(tvec1<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec1(tvec1<T, Q> const & v);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_vec1.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P>::tvec1(tvec1<T, P> const & v)
: x(v.x)
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_vec2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

GLM_FUNC_DECL tvec2() GLM_DEFAULT;
GLM_FUNC_DECL tvec2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec2(tvec2<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec2(tvec2<T, Q> const & v);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_vec2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P>::tvec2(tvec2<T, P> const & v)
: x(v.x), y(v.y)
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_vec3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

GLM_FUNC_DECL tvec3() GLM_DEFAULT;
GLM_FUNC_DECL tvec3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec3(tvec3<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_vec3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, P> const & v)
: x(v.x), y(v.y), z(v.z)
Expand Down
2 changes: 1 addition & 1 deletion glm/detail/type_vec4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ namespace detail
//////////////////////////////////////
// Implicit basic constructors

GLM_FUNC_DECL tvec4() GLM_DEFAULT;
GLM_FUNC_DECL tvec4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tvec4(tvec4<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
Expand Down
4 changes: 3 additions & 1 deletion glm/detail/type_vec4.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

# if !GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0), w(0)
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
Expand Down
2 changes: 1 addition & 1 deletion glm/gtc/quaternion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace glm
//////////////////////////////////////
// Implicit basic constructors

GLM_FUNC_DECL tquat() GLM_DEFAULT;
GLM_FUNC_DECL tquat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tquat(tquat<T, P> const & q) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tquat(tquat<T, Q> const & q);
Expand Down
Loading

0 comments on commit afa1937

Please sign in to comment.