mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-29 18:07:16 +02:00
Merge pull request #697 from rothmichaels/bugfix/xcode-build
Fix Xcode long build times and/or crashes
This commit is contained in:
9
.github/generate-job-matrix.py
vendored
9
.github/generate-job-matrix.py
vendored
@ -97,11 +97,10 @@ configs = {
|
|||||||
# arm64 runners are expensive; only consider one version
|
# arm64 runners are expensive; only consider one version
|
||||||
if ver == 18 or platform != "arm64"
|
if ver == 18 or platform != "arm64"
|
||||||
]
|
]
|
||||||
# TODO uncomment the below when apple-clang-15 crash is fixed
|
+ [
|
||||||
# + [
|
make_apple_clang_config("macos-13", ver, std_format_support=False)
|
||||||
# make_apple_clang_config("macos-13", ver, std_format_support=False)
|
for ver in ["15.2"]
|
||||||
# for ver in ["15.2"]
|
]
|
||||||
# ]
|
|
||||||
# std::format is available in Xcode 16.1 or later
|
# std::format is available in Xcode 16.1 or later
|
||||||
+ [
|
+ [
|
||||||
make_apple_clang_config("macos-14", ver, std_format_support=True)
|
make_apple_clang_config("macos-14", ver, std_format_support=True)
|
||||||
|
@ -44,12 +44,7 @@ namespace mp_units {
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
concept WeaklyRegular =
|
concept WeaklyRegular = std::copyable<T> && std::equality_comparable<T>;
|
||||||
#ifndef MP_UNITS_XCODE15_HACKS
|
|
||||||
true;
|
|
||||||
#else
|
|
||||||
std::copyable<T> && std::equality_comparable<T>;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<typename T, typename S>
|
template<typename T, typename S>
|
||||||
concept ScalableWith = requires(const T v, const S s) {
|
concept ScalableWith = requires(const T v, const S s) {
|
||||||
@ -175,13 +170,18 @@ template<typename T>
|
|||||||
concept ComplexScalar =
|
concept ComplexScalar =
|
||||||
// TODO should the below be provided?
|
// TODO should the below be provided?
|
||||||
// (!disable_complex<T>) &&
|
// (!disable_complex<T>) &&
|
||||||
Addable<T> && ScalableWith<T, T> && requires(const T v, const T& ref) {
|
Addable<T> && ScalableWith<T, T> &&
|
||||||
|
requires(const T v, const T& ref) {
|
||||||
::mp_units::real(v);
|
::mp_units::real(v);
|
||||||
::mp_units::imag(v);
|
::mp_units::imag(v);
|
||||||
::mp_units::modulus(v);
|
::mp_units::modulus(v);
|
||||||
requires ScalableWith<T, decltype(::mp_units::modulus(v))>;
|
requires ScalableWith<T, decltype(::mp_units::modulus(v))>;
|
||||||
requires std::constructible_from<T, decltype(::mp_units::real(ref)), decltype(::mp_units::imag(ref))>;
|
requires std::constructible_from<T, decltype(::mp_units::real(ref)), decltype(::mp_units::imag(ref))>;
|
||||||
} && WeaklyRegular<T>;
|
}
|
||||||
|
#ifndef MP_UNITS_XCODE15_HACKS
|
||||||
|
&& WeaklyRegular<T>
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
@ -197,8 +197,12 @@ MP_UNITS_INLINE constexpr bool disable_real<bool> = true;
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
concept RealScalar = (!disable_real<T>) && Addable<T> && ScalableWith<T, T> && std::totally_ordered<T> &&
|
concept RealScalar =
|
||||||
(!ComplexScalar<T>) && WeaklyRegular<T>;
|
(!disable_real<T>) && Addable<T> && ScalableWith<T, T> && std::totally_ordered<T> && (!ComplexScalar<T>)
|
||||||
|
#if MP_UNITS_COMP_GCC != 12 && !defined(MP_UNITS_XCODE15_HACKS)
|
||||||
|
&& WeaklyRegular<T>
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
concept Scalar = RealScalar<T> || ComplexScalar<T>;
|
concept Scalar = RealScalar<T> || ComplexScalar<T>;
|
||||||
@ -250,15 +254,20 @@ MP_UNITS_EXPORT inline constexpr ::mp_units::detail::magnitude_impl::magnitude_t
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
concept Vector = Addable<T> && requires(const T v) {
|
concept Vector = Addable<T> &&
|
||||||
::mp_units::magnitude(v);
|
requires(const T v) {
|
||||||
requires ScalableWith<T, decltype(::mp_units::magnitude(v))>;
|
::mp_units::magnitude(v);
|
||||||
// TODO should we also check for the below (e.g., when `size() > 1` or `2`)
|
requires ScalableWith<T, decltype(::mp_units::magnitude(v))>;
|
||||||
// ::mp_units::zero_vector<T>();
|
// TODO should we also check for the below (e.g., when `size() > 1` or `2`)
|
||||||
// ::mp_units::scalar_product(a, b);
|
// ::mp_units::zero_vector<T>();
|
||||||
// ::mp_units::vector_product(a, b);
|
// ::mp_units::scalar_product(a, b);
|
||||||
// ::mp_units::tensor_product(a, b);
|
// ::mp_units::vector_product(a, b);
|
||||||
} && WeaklyRegular<T>;
|
// ::mp_units::tensor_product(a, b);
|
||||||
|
}
|
||||||
|
#ifndef MP_UNITS_XCODE15_HACKS
|
||||||
|
&& WeaklyRegular<T>
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
@ -331,11 +340,22 @@ concept SomeRepresentation =
|
|||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
#ifdef MP_UNITS_XCODE15_HACKS
|
||||||
|
MP_UNITS_EXPORT template<typename T, auto V>
|
||||||
|
concept RepresentationOf =
|
||||||
|
detail::SomeRepresentation<T> &&
|
||||||
|
((QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(V))> &&
|
||||||
|
(detail::QuantityKindSpec<MP_UNITS_REMOVE_CONST(decltype(V))> || detail::IsOfCharacter<T, V.character>)) ||
|
||||||
|
(std::same_as<quantity_character, decltype(V)> && detail::IsOfCharacter<T, V>));
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
MP_UNITS_EXPORT template<typename T, auto V>
|
MP_UNITS_EXPORT template<typename T, auto V>
|
||||||
concept RepresentationOf =
|
concept RepresentationOf =
|
||||||
((QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(V))> &&
|
((QuantitySpec<MP_UNITS_REMOVE_CONST(decltype(V))> &&
|
||||||
((detail::QuantityKindSpec<MP_UNITS_REMOVE_CONST(decltype(V))> && detail::SomeRepresentation<T>) ||
|
((detail::QuantityKindSpec<MP_UNITS_REMOVE_CONST(decltype(V))> && detail::SomeRepresentation<T>) ||
|
||||||
detail::IsOfCharacter<T, V.character>)) ||
|
detail::IsOfCharacter<T, V.character>)) ||
|
||||||
(std::same_as<quantity_character, decltype(V)> && detail::IsOfCharacter<T, V>));
|
(std::same_as<quantity_character, decltype(V)> && detail::IsOfCharacter<T, V>));
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace mp_units
|
} // namespace mp_units
|
||||||
|
Reference in New Issue
Block a user