Use constexpr only with C++14 compiler

This commit is contained in:
Groove
2018-07-24 23:41:55 +02:00
parent 97e189606f
commit c3c8b73c57
60 changed files with 685 additions and 702 deletions

View File

@@ -1291,13 +1291,13 @@ namespace ldexp_
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::abs(1.0f) > 0.0f, "GLM: Failed constexpr");
static_assert(glm::abs(glm::vec1(1.0f)) != glm::vec1(0.0f), "GLM: Failed constexpr");
static_assert(glm::abs(glm::vec2(1.0f)) != glm::vec2(0.0f), "GLM: Failed constexpr");
static_assert(glm::abs(glm::vec3(1.0f)) != glm::vec3(0.0f), "GLM: Failed constexpr");
static_assert(glm::abs(glm::vec4(1.0f)) != glm::vec4(0.0f), "GLM: Failed constexpr");
#endif // GLM_HAS_CONSTEXPR_CXX14
#endif // GLM_HAS_CONSTEXPR
return 0;
}

View File

@@ -157,7 +157,7 @@ int test_size()
int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr");
#endif

View File

@@ -122,7 +122,7 @@ int test_size()
int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat2x3::length() == 2, "GLM: Failed constexpr");
#endif

View File

@@ -124,7 +124,7 @@ static int test_size()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat2x4::length() == 2, "GLM: Failed constexpr");
#endif

View File

@@ -126,7 +126,7 @@ static int test_size()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat3x2::length() == 3, "GLM: Failed constexpr");
#endif

View File

@@ -185,10 +185,10 @@ static int test_size()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr");
GLM_CONSTEXPR_CXX11 glm::mat3x3 const Z(0.0f);
GLM_CONSTEXPR glm::mat3x3 const Z(0.0f);
static_assert(Z[0] == glm::vec3(0.0f), "GLM: Failed constexpr");
static_assert(Z == glm::mat3x3(0.0f), "GLM: Failed constexpr");
#endif

View File

@@ -128,7 +128,7 @@ static int test_size()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat3x4::length() == 3, "GLM: Failed constexpr");
#endif

View File

@@ -130,7 +130,7 @@ static int test_size()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat4x2::length() == 4, "GLM: Failed constexpr");
#endif

View File

@@ -130,7 +130,7 @@ static int test_size()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat4x3::length() == 4, "GLM: Failed constexpr");
#endif

View File

@@ -323,7 +323,7 @@ static int test_constexpr()
{
glm::mat4 const I(1.0f);
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::mat4::length() == 4, "GLM: Failed constexpr");
#endif

View File

@@ -145,7 +145,7 @@ static int test_swizzle()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr");
static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr");
#endif

View File

@@ -299,7 +299,7 @@ static int test_size()
Error += glm::vec2::length() == 2 ? 0 : 1;
Error += glm::dvec2::length() == 2 ? 0 : 1;
GLM_CONSTEXPR_CXX11 std::size_t Length = glm::vec2::length();
GLM_CONSTEXPR std::size_t Length = glm::vec2::length();
Error += Length == 2 ? 0 : 1;
return Error;
@@ -334,7 +334,7 @@ static int test_operator_increment()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr");
static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr");
static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr");

View File

@@ -307,7 +307,7 @@ int test_vec3_size()
Error += glm::vec3::length() == 3 ? 0 : 1;
Error += glm::dvec3::length() == 3 ? 0 : 1;
GLM_CONSTEXPR_CXX11 std::size_t Length = glm::vec3::length();
GLM_CONSTEXPR std::size_t Length = glm::vec3::length();
Error += Length == 3 ? 0 : 1;
return Error;
@@ -595,7 +595,7 @@ static int test_swizzle()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr");
static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr");
static_assert(glm::vec3(1.0f) == glm::vec3(1.0f), "GLM: Failed constexpr");

View File

@@ -749,7 +749,7 @@ static int test_inheritance()
static int test_constexpr()
{
#if GLM_HAS_CONSTEXPR_CXX14
#if GLM_HAS_CONSTEXPR
static_assert(glm::vec4::length() == 4, "GLM: Failed constexpr");
static_assert(glm::vec4(1.0f).x > 0.0f, "GLM: Failed constexpr");
static_assert(glm::vec4(1.0f) == glm::vec4(1.0f), "GLM: Failed constexpr");