mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 20:54:28 +02:00
range-v3 dependency removed for gcc-10
This commit is contained in:
@@ -47,10 +47,11 @@ class UnitsConan(ConanFile):
|
|||||||
exports_sources = ["src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
|
exports_sources = ["src/*", "test/*", "cmake/*", "example/*","CMakeLists.txt"]
|
||||||
settings = "os", "compiler", "build_type", "arch"
|
settings = "os", "compiler", "build_type", "arch"
|
||||||
requires = (
|
requires = (
|
||||||
"range-v3/0.9.1@ericniebler/stable",
|
|
||||||
"Catch2/2.10.0@catchorg/stable",
|
|
||||||
"fmt/6.0.0"
|
"fmt/6.0.0"
|
||||||
)
|
)
|
||||||
|
build_requires = (
|
||||||
|
"Catch2/2.10.0@catchorg/stable"
|
||||||
|
)
|
||||||
generators = "cmake"
|
generators = "cmake"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -73,6 +74,10 @@ class UnitsConan(ConanFile):
|
|||||||
cmake.configure(source_folder="src", build_folder="src")
|
cmake.configure(source_folder="src", build_folder="src")
|
||||||
return cmake
|
return cmake
|
||||||
|
|
||||||
|
def requirements(self):
|
||||||
|
if Version(self.settings.compiler.version) < "10":
|
||||||
|
self.requires("range-v3/0.10.0@ericniebler/stable")
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
cmake = self._configure_cmake()
|
cmake = self._configure_cmake()
|
||||||
cmake.build()
|
cmake.build()
|
||||||
|
@@ -53,7 +53,6 @@ add_library(units INTERFACE)
|
|||||||
target_compile_features(units INTERFACE cxx_std_20)
|
target_compile_features(units INTERFACE cxx_std_20)
|
||||||
target_link_libraries(units
|
target_link_libraries(units
|
||||||
INTERFACE
|
INTERFACE
|
||||||
CONAN_PKG::range-v3
|
|
||||||
CONAN_PKG::fmt
|
CONAN_PKG::fmt
|
||||||
)
|
)
|
||||||
target_include_directories(units
|
target_include_directories(units
|
||||||
@@ -71,6 +70,11 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
-Wno-pedantic
|
-Wno-pedantic
|
||||||
)
|
)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0)
|
||||||
|
target_link_libraries(units
|
||||||
|
INTERFACE
|
||||||
|
CONAN_PKG::range-v3
|
||||||
|
)
|
||||||
|
|
||||||
target_compile_options(units
|
target_compile_options(units
|
||||||
INTERFACE
|
INTERFACE
|
||||||
-fconcepts
|
-fconcepts
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <concepts/concepts.hpp>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
@@ -32,16 +31,24 @@
|
|||||||
#define Expects(cond) assert(cond);
|
#define Expects(cond) assert(cond);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __GNUC__ > 9
|
#if __GNUC__ < 10
|
||||||
#define AUTO auto
|
|
||||||
#define SAME_AS(T) std::same_as<T>
|
#include <concepts/concepts.hpp>
|
||||||
#else
|
|
||||||
#define AUTO
|
#define AUTO
|
||||||
#define SAME_AS(T) T
|
#define SAME_AS(T) T
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <concepts>
|
||||||
|
#define AUTO auto
|
||||||
|
#define SAME_AS(T) std::same_as<T>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
|
|
||||||
|
#if __GNUC__ < 10
|
||||||
|
|
||||||
// concepts
|
// concepts
|
||||||
using concepts::common_reference_with;
|
using concepts::common_reference_with;
|
||||||
using concepts::common_with;
|
using concepts::common_with;
|
||||||
@@ -64,4 +71,11 @@ namespace std {
|
|||||||
template<class F, class... Args>
|
template<class F, class... Args>
|
||||||
concept regular_invocable = invocable<F, 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 {
|
namespace units {
|
||||||
|
|
||||||
template<std::size_t N, typename D, typename U, typename Rep>
|
template<std::size_t N, typename D, typename U, typename Rep>
|
||||||
requires N == 0
|
requires (N == 0)
|
||||||
inline Rep AUTO pow(const quantity<D, U, Rep>&) noexcept
|
inline Rep pow(const quantity<D, U, Rep>&) noexcept
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -111,7 +111,7 @@ static_assert(std::is_same_v<
|
|||||||
unknown_dimension<exp<d0, 1>, exp<d2, 1>>>);
|
unknown_dimension<exp<d0, 1>, exp<d2, 1>>>);
|
||||||
static_assert(std::is_same_v<dimension_multiply<derived_dimension<exp<d0, 1>>, derived_dimension<exp<d0, -1>>>,
|
static_assert(std::is_same_v<dimension_multiply<derived_dimension<exp<d0, 1>>, derived_dimension<exp<d0, -1>>>,
|
||||||
unknown_dimension<>>);
|
unknown_dimension<>>);
|
||||||
static_assert(std::is_same_v<dimension_multiply<derived_dimension<exp<d0, 2>>, unknown_dimension<exp<d0, -1>>>, d0>);
|
static_assert(std::is_same_v<dimension_multiply<derived_dimension<exp<d0, 2>>, derived_dimension<exp<d0, -1>>>, d0>);
|
||||||
|
|
||||||
// dimension_divide
|
// dimension_divide
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user