forked from mpusz/mp-units
Merge branch 'master' into mag-value-t
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
function(check_libcxx_in_use variable)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
message(CHECK_START "Checking if libc++ is being used")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ check_libcxx_in_use(${projectPrefix}LIBCXX)
|
||||
add_library(mp-units-core INTERFACE)
|
||||
target_compile_features(mp-units-core INTERFACE cxx_std_20)
|
||||
target_link_libraries(mp-units-core INTERFACE
|
||||
gsl-lite::gsl-lite
|
||||
gsl::gsl-lite
|
||||
)
|
||||
target_include_directories(mp-units-core ${unitsAsSystem} INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if(${projectPrefix}LIBCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14")
|
||||
find_package(range-v3 CONFIG REQUIRED)
|
||||
target_link_libraries(mp-units-core INTERFACE range-v3::range-v3)
|
||||
|
||||
@@ -47,7 +47,7 @@ constexpr ratio inverse_if_negative(const ratio& r)
|
||||
template<Unit... Us, typename... Es>
|
||||
constexpr ratio derived_ratio(exponent_list<Es...>)
|
||||
{
|
||||
return (... * inverse_if_negative<Es>(pow<detail::abs(Es::num)>(Us::ratio) / dimension_unit<typename Es::dimension>::ratio));
|
||||
return (... * inverse_if_negative<Es>(pow<detail::abs(Es::num)>(Us::ratio / dimension_unit<typename Es::dimension>::ratio)));
|
||||
}
|
||||
|
||||
template<DerivedDimension D, Unit... Us>
|
||||
|
||||
+4
-9
@@ -63,18 +63,13 @@
|
||||
#define UNITS_DIAGNOSTIC_IGNORE_UNREACHABLE UNITS_DIAGNOSTIC_IGNORE(4702)
|
||||
#endif
|
||||
|
||||
#if UNITS_COMP_CLANG
|
||||
|
||||
#include <ciso646>
|
||||
#if _LIBCPP_VERSION
|
||||
#define UNITS_LIBCXX _LIBCPP_VERSION
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if UNITS_LIBCXX
|
||||
|
||||
#if UNITS_COMP_CLANG == 12
|
||||
#if UNITS_LIBCXX < 13000
|
||||
|
||||
#include <concepts/concepts.hpp>
|
||||
#include <range/v3/algorithm/lower_bound.hpp>
|
||||
@@ -84,7 +79,7 @@
|
||||
#include <range/v3/iterator/concepts.hpp>
|
||||
#include <range/v3/range/concepts.hpp>
|
||||
|
||||
#elif UNITS_COMP_CLANG == 13
|
||||
#elif UNITS_LIBCXX < 14000
|
||||
|
||||
#include <range/v3/functional/comparisons.hpp>
|
||||
|
||||
@@ -115,7 +110,7 @@ concept default_constructible = constructible_from<T>;
|
||||
|
||||
#elif UNITS_LIBCXX
|
||||
|
||||
#if UNITS_COMP_CLANG == 12
|
||||
#if UNITS_LIBCXX < 13000
|
||||
|
||||
// concepts
|
||||
using concepts::common_with;
|
||||
@@ -228,7 +223,7 @@ constexpr bool in_range(T t) noexcept
|
||||
std::cmp_less_equal(t, std::numeric_limits<R>::max());
|
||||
}
|
||||
|
||||
#elif UNITS_COMP_CLANG == 13
|
||||
#elif UNITS_LIBCXX < 14000
|
||||
|
||||
using concepts::three_way_comparable;
|
||||
using concepts::three_way_comparable_with;
|
||||
|
||||
@@ -363,16 +363,6 @@ concept Magnitude = detail::is_magnitude<T>;
|
||||
template<typename T>
|
||||
T get_value(Magnitude auto m) { return m.template value<T>; }
|
||||
|
||||
/**
|
||||
* @brief Convert any positive integer to a Magnitude.
|
||||
*
|
||||
* This will be the main way end users create Magnitudes. They should rarely (if ever) create a magnitude<...> by
|
||||
* manually adding base powers.
|
||||
*/
|
||||
template<ratio R>
|
||||
requires (R.num > 0)
|
||||
constexpr Magnitude auto as_magnitude();
|
||||
|
||||
/**
|
||||
* @brief A base to represent pi.
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
# SOFTWARE.
|
||||
|
||||
function(__check_libcxx_in_use variable)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
message(CHECK_START "Checking if libc++ is being used")
|
||||
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||
|
||||
@@ -43,7 +43,7 @@ find_dependency(fmt)
|
||||
find_dependency(gsl-lite)
|
||||
|
||||
# add range-v3 dependency only for clang + libc++
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
__check_libcxx_in_use(__units_libcxx)
|
||||
if(__units_libcxx AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14")
|
||||
find_dependency(range-v3)
|
||||
|
||||
Reference in New Issue
Block a user