From dc4243f928b2a686d4f6f4ca5a9c199b01f36d09 Mon Sep 17 00:00:00 2001 From: Christian Mattes Date: Thu, 12 Apr 2018 17:53:54 +0200 Subject: [PATCH] Now builds on VS 2013 --- src/Unittests/CMakeLists.txt | 3 +-- .../unittests_common_customtraits.hh | 22 +++++++------------ src/Unittests/unittests_trimesh_others.cc | 2 +- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/Unittests/CMakeLists.txt b/src/Unittests/CMakeLists.txt index a8b02724..3843175f 100644 --- a/src/Unittests/CMakeLists.txt +++ b/src/Unittests/CMakeLists.txt @@ -74,8 +74,7 @@ if ( OPENMESH_BUILD_UNIT_TESTS ) else() # Set compiler flags set_target_properties(unittests PROPERTIES COMPILE_FLAGS "" ) - set_target_properties(unittests_customvec PROPERTIES COMPILE_FLAGS "-g -pedantic -Wno-long-long") - + set_target_properties(unittests_customvec PROPERTIES COMPILE_FLAGS "" ) endif() if ( OPENMESH_BUILD_SHARED ) diff --git a/src/Unittests/unittests_common_customtraits.hh b/src/Unittests/unittests_common_customtraits.hh index a53f724d..bb3ec8f8 100644 --- a/src/Unittests/unittests_common_customtraits.hh +++ b/src/Unittests/unittests_common_customtraits.hh @@ -2,6 +2,7 @@ #define UNITTESTS_COMMON_DUMMYTRAITS #include #include +#include namespace Custom { @@ -10,20 +11,13 @@ namespace Custom { template class Vec { public: // Constructor with DIM components - template ::type, - typename = typename std::enable_if< - are_convertible_to::value>::type> - constexpr Vec(T v, Ts... vs) - : data{{static_cast(v), static_cast(vs)...}} { - static_assert(sizeof...(Ts)+1 == DIM, - "Invalid number of components specified in constructor."); - static_assert(are_convertible_to::value, - "Not all components are convertible to Scalar."); - } - - constexpr Vec() = default; - constexpr Vec(Vec const &) = default; + Vec(float x) : data({ x }) {} + Vec(float x, float y) : data({ x, y }) {} + Vec(float x, float y, float z) : data({ x, y, z }) {} + Vec(float x, float y, float z, float w) : data({ x, y, z, w }) {} + + Vec() = default; + Vec(Vec const &) = default; float &operator[](int i) { return data[i]; } float operator[](int i) const { return data[i]; } diff --git a/src/Unittests/unittests_trimesh_others.cc b/src/Unittests/unittests_trimesh_others.cc index e7fb2d20..5a771021 100644 --- a/src/Unittests/unittests_trimesh_others.cc +++ b/src/Unittests/unittests_trimesh_others.cc @@ -165,7 +165,7 @@ TEST_F(OpenMeshOthers, CalcDihedralAngre ) { // Modify point Mesh::Point tmp = ( Mesh::Point(0.0, 0.0, -1.0) + Mesh::Point(1.0, 1.0, -1.0) ) - * static_cast::value_type>(0.5); + * static_cast::value_type>(0.5); mesh_.point(vhandle[2]) = tmp; double difference = fabs( 1.36944 - mesh_.calc_dihedral_angle(eh) );