Added support of defaulted functions to *vec* types #366

This commit is contained in:
Christophe Riccio
2015-07-25 01:24:03 +02:00
parent 063c5c7367
commit f7751bfb06
14 changed files with 229 additions and 131 deletions

View File

@@ -69,6 +69,22 @@ int test_vec1_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec1 f;
glm::ivec1 i;
} A, B;
A.f = glm::vec1(0);
Error += glm::all(glm::equal(A.i, glm::ivec1(0))) ? 0 : 1;
B.f = glm::vec1(1);
Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
# if GLM_HAS_TRIVIAL_QUERIES
// Error += std::is_trivially_default_constructible<glm::vec1>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;

View File

@@ -229,6 +229,22 @@ int test_vec2_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec2 f;
glm::ivec2 i;
} A, B;
A.f = glm::vec2(0);
Error += glm::all(glm::equal(A.i, glm::ivec2(0))) ? 0 : 1;
B.f = glm::vec2(1);
Error += glm::all(glm::equal(B.i, glm::ivec2(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
# if GLM_HAS_TRIVIAL_QUERIES
// Error += std::is_trivially_default_constructible<glm::vec2>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;

View File

@@ -45,6 +45,22 @@ int test_vec3_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec3 f;
glm::ivec3 i;
} A, B;
A.f = glm::vec3(0);
Error += glm::all(glm::equal(A.i, glm::ivec3(0))) ? 0 : 1;
B.f = glm::vec3(1);
Error += glm::all(glm::equal(B.i, glm::ivec3(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
# if GLM_HAS_TRIVIAL_QUERIES
// Error += std::is_trivially_default_constructible<glm::vec3>::value ? 0 : 1;
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;

View File

@@ -68,6 +68,22 @@ int test_vec4_ctor()
{
int Error = 0;
# if GLM_HAS_DEFAULTED_FUNCTIONS
{
union pack
{
glm::vec4 f;
glm::ivec4 i;
} A, B;
A.f = glm::vec4(0);
Error += glm::all(glm::equal(A.i, glm::ivec4(0))) ? 0 : 1;
B.f = glm::vec4(1);
Error += glm::all(glm::equal(B.i, glm::ivec4(1065353216))) ? 0 : 1;
}
# endif//GLM_HAS_DEFAULTED_FUNCTIONS
{
glm::ivec4 A(1, 2, 3, 4);
glm::ivec4 B(A);