range-v3 dependency removed for gcc-10
This commit is contained in:
1 parent
2c29af9670
commit
d465d47803
5 files changed
+35
-12
No files matched your search
+5
-1
@@ -53,7 +53,6 @@ add_library(units INTERFACE)
|
||||
target_compile_features(units INTERFACE cxx_std_20)
|
||||
target_link_libraries(units
|
||||
INTERFACE
|
||||
CONAN_PKG::range-v3
|
||||
CONAN_PKG::fmt
|
||||
)
|
||||
target_include_directories(units
|
||||
@@ -71,6 +70,11 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
-Wno-pedantic
|
||||
)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
|
||||
target_link_libraries(units
|
||||
INTERFACE
|
||||
CONAN_PKG::range-v3
|
||||
)
|
||||
|
||||
target_compile_options(units
|
||||
INTERFACE
|
||||
-fconcepts
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <concepts/concepts.hpp>
|
||||
#include <functional>
|
||||
|
||||
#ifdef NDEBUG
|
||||
@@ -32,16 +31,24 @@
|
||||
#define Expects(cond) assert(cond);
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 9
|
||||
#define AUTO auto
|
||||
#define SAME_AS(T) std::same_as<T>
|
||||
#else
|
||||
#if __GNUC__ < 10
|
||||
|
||||
#include <concepts/concepts.hpp>
|
||||
#define AUTO
|
||||
#define SAME_AS(T) T
|
||||
|
||||
#else
|
||||
|
||||
#include <concepts>
|
||||
#define AUTO auto
|
||||
#define SAME_AS(T) std::same_as<T>
|
||||
|
||||
#endif
|
||||
|
||||
namespace std {
|
||||
|
||||
#if __GNUC__ < 10
|
||||
|
||||
// concepts
|
||||
using concepts::common_reference_with;
|
||||
using concepts::common_with;
|
||||
@@ -64,4 +71,11 @@ namespace std {
|
||||
template<class F, class... Args>
|
||||
concept regular_invocable = invocable<F, Args...>;
|
||||
|
||||
}
|
||||
#else
|
||||
|
||||
template<class T>
|
||||
concept default_constructible = constructible_from<T>;
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace std
|
||||
@@ -28,8 +28,8 @@
|
||||
namespace units {
|
||||
|
||||
template<std::size_t N, typename D, typename U, typename Rep>
|
||||
requires N == 0
|
||||
inline Rep AUTO pow(const quantity<D, U, Rep>&) noexcept
|
||||
requires (N == 0)
|
||||
inline Rep pow(const quantity<D, U, Rep>&) noexcept
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user