Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed use of =default for vector types #543

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions glm/detail/type_vec1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace glm
// -- Implicit basic constructors --

GLM_FUNC_DECL GLM_CONSTEXPR tvec1() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, Q> const & v);

Expand Down Expand Up @@ -120,7 +120,7 @@ namespace glm
*/
// -- Unary arithmetic operators --

GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P> const & v) GLM_DEFAULT;
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);
Expand Down
24 changes: 10 additions & 14 deletions glm/detail/type_vec1.inl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ namespace glm
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec1<T, P> const & v)
: x(v.x)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec1<T, P> const & v)
: x(v.x)
{}

template <typename T, precision P>
template <precision Q>
Expand Down Expand Up @@ -88,14 +86,12 @@ namespace glm

// -- Unary arithmetic operators --

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<T, P> const & v)
{
this->x = v.x;
return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<T, P> const & v)
{
this->x = v.x;
return *this;
}

template <typename T, precision P>
template <typename U>
Expand Down
4 changes: 2 additions & 2 deletions glm/detail/type_vec2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace glm
// -- Implicit basic constructors --

GLM_FUNC_DECL GLM_CONSTEXPR tvec2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, P> const& v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, P> const& v);
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, Q> const& v);

Expand Down Expand Up @@ -126,7 +126,7 @@ namespace glm

// -- Unary arithmetic operators --

GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<T, P> const & v) GLM_DEFAULT;
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);
Expand Down
26 changes: 11 additions & 15 deletions glm/detail/type_vec2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ namespace glm
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec2<T, P> const & v)
: x(v.x), y(v.y)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(tvec2<T, P> const & v)
: x(v.x), y(v.y)
{}

template <typename T, precision P>
template <precision Q>
Expand Down Expand Up @@ -119,15 +117,13 @@ namespace glm

// -- Unary arithmetic operators --

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator=(tvec2<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> & tvec2<T, P>::operator=(tvec2<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
return *this;
}

template <typename T, precision P>
template <typename U>
Expand Down
4 changes: 2 additions & 2 deletions glm/detail/type_vec3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace glm
// -- Implicit basic constructors --

GLM_FUNC_DECL GLM_CONSTEXPR tvec3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, Q> const & v);

Expand Down Expand Up @@ -147,7 +147,7 @@ namespace glm

// -- Unary arithmetic operators --

GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> const & v) GLM_DEFAULT;
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);
Expand Down
28 changes: 12 additions & 16 deletions glm/detail/type_vec3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ namespace glm
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec3<T, P> const & v)
: x(v.x), y(v.y), z(v.z)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(tvec3<T, P> const & v)
: x(v.x), y(v.y), z(v.z)
{}

template <typename T, precision P>
template <precision Q>
Expand Down Expand Up @@ -161,16 +159,14 @@ namespace glm

// -- Unary arithmetic operators --

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
return *this;
}

template <typename T, precision P>
template <typename U>
Expand Down
4 changes: 2 additions & 2 deletions glm/detail/type_vec4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace glm
// -- Implicit basic constructors --

GLM_FUNC_DECL GLM_CONSTEXPR tvec4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec4<T, P> const& v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec4<T, P> const& v);
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec4(tvec4<T, Q> const& v);

Expand Down Expand Up @@ -192,7 +192,7 @@ namespace glm

// -- Unary arithmetic operators --

GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v);

template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);
Expand Down
30 changes: 13 additions & 17 deletions glm/detail/type_vec4.inl
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,10 @@ namespace detail
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec4<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(tvec4<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
{}

template <typename T, precision P>
template <precision Q>
Expand Down Expand Up @@ -346,17 +344,15 @@ namespace detail

// -- Unary arithmetic operators --

# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>& tvec4<T, P>::operator=(tvec4<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
this->w = v.w;
return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>& tvec4<T, P>::operator=(tvec4<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
this->w = v.w;
return *this;
}

template <typename T, precision P>
template <typename U>
Expand Down
2 changes: 1 addition & 1 deletion glm/gtc/matrix_transform.inl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace glm
T bottom, T top
)
{
tmat4x4<T, defaultp> Result(1);
tmat4x4<T, defaultp> Result(T(1));
Result[0][0] = static_cast<T>(2) / (right - left);
Result[1][1] = static_cast<T>(2) / (top - bottom);
Result[2][2] = - static_cast<T>(1);
Expand Down
2 changes: 1 addition & 1 deletion glm/gtx/transform.inl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace glm
tvec3<T, P> const & v)
{
return translate(
tmat4x4<T, P>(1.0f), v);
tmat4x4<T, P>(T(1)), v);
}

template <typename T, precision P>
Expand Down