VS2019 support added

This commit is contained in:
Mateusz Pusz
2020-09-04 23:06:57 +02:00
parent 71e3dba69a
commit b318e8d039
38 changed files with 253 additions and 160 deletions
+10 -3
View File
@@ -25,7 +25,6 @@ function(add_example target)
target_link_libraries(${target} PRIVATE mp::units)
endfunction()
add_example(avg_speed)
add_example(box_example)
add_example(capacitor_time_curve)
add_example(clcpp_response)
@@ -33,7 +32,6 @@ add_example(conversion_factor)
add_example(experimental_angle)
add_example(foot_pound_second)
add_example(glide_computer)
add_example(hello_units)
add_example(kalman_filter-alpha_beta_filter_example2)
conan_check_testing(linear_algebra)
@@ -44,7 +42,16 @@ target_link_libraries(linear_algebra
)
add_example(measurement)
add_example(total_energy)
add_example(unknown_dimension)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# TODO Those examples use Concepts terse syntax not yet supported by MSVC
add_example(avg_speed)
add_example(hello_units)
add_example(total_energy)
add_subdirectory(alternative_namespaces)
endif()
+5 -1
View File
@@ -28,6 +28,10 @@
#include <array>
#include <iostream>
#if COMP_MSVC || COMP_GCC >= 10
#include <compare>
#endif
// horizontal/vertical vector
namespace {
@@ -70,7 +74,7 @@ public:
return *this;
}
#if __GNUC__ >= 10
#if COMP_MSVC || COMP_GCC >= 10
template<typename Q2>
[[nodiscard]] friend constexpr auto operator<=>(const vector& lhs, const vector<Q2, D>& rhs)
+6 -2
View File
@@ -24,6 +24,10 @@
#include <cmath>
#include <iostream>
#if COMP_MSVC || COMP_GCC >= 10
#include <compare>
#endif
namespace {
// root sum of squares
@@ -101,9 +105,9 @@ public:
return measurement(val, val * rhs.relative_uncertainty());
}
#if __GNUC__ >= 10
#if COMP_MSVC || COMP_GCC >= 10
[[nodiscard]] friend constexpr auto operator<=>(const measurement& lhs, const measurement& rhs) = default;
[[nodiscard]] constexpr auto operator<=>(const measurement&) const = default;
#else