Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft/Catch3/Generators/Integer.hpp
diff options
context:
space:
mode:
authorLeitwolf2026-10-31 17:18:21 +0300
committerGitHub2026-10-31 17:18:21 +0300
commit326ea0c0213aeecb6b984bba3dabb0ebad97679e (patch)
tree5cec698f0bc0b8a60f45e866fb40f2fd8a358bd1 /src/Progmasoft/Catch3/Generators/Integer.hpp
parent6a42cdf6461b2577106ef094d6f98025554b6077 (diff)
parentafe91797e9d50cd4712d3694a2e5fedfc0b966b1 (diff)
downloadcatch3-326ea0c0213aeecb6b984bba3dabb0ebad97679e.tar.gz
Merge pull request #22 from Progmasoft/build/cpp17
Build Catch3 as C++17
Diffstat (limited to 'src/Progmasoft/Catch3/Generators/Integer.hpp')
-rw-r--r--src/Progmasoft/Catch3/Generators/Integer.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Progmasoft/Catch3/Generators/Integer.hpp b/src/Progmasoft/Catch3/Generators/Integer.hpp
index 45192b3d..3659aa4f 100644
--- a/src/Progmasoft/Catch3/Generators/Integer.hpp
+++ b/src/Progmasoft/Catch3/Generators/Integer.hpp
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-1.1
#pragma once
+#include <Progmasoft/Catch3/Detail/TypeTraits.hpp>
#include <Progmasoft/Catch3/Generator.hpp>
#include <algorithm>
-#include <concepts>
#include <limits>
#include <type_traits>
@@ -13,8 +13,7 @@ namespace Progmasoft::Catch3
namespace Detail
{
- template<std::integral IntegerType>
- requires(!std::same_as<IntegerType, bool>)
+ template<typename IntegerType, Detail::EnableIfInteger<IntegerType> = 0>
[[nodiscard]] std::vector<IntegerType>
ShrinkInteger(IntegerType value,
IntegerType minimum,
@@ -24,7 +23,9 @@ namespace Progmasoft::Catch3
const auto addCandidate = [&](IntegerType candidate) {
if (candidate < minimum || candidate > maximum
|| candidate == value
- || std::ranges::find(candidates, candidate)
+ || std::find(candidates.begin(),
+ candidates.end(),
+ candidate)
!= candidates.end())
{
return;
@@ -86,8 +87,7 @@ namespace Progmasoft::Catch3
/// Generates integers over the inclusive range and shrinks toward simple
/// values.
- template<std::integral IntegerType>
- requires(!std::same_as<IntegerType, bool>)
+ template<typename IntegerType, Detail::EnableIfInteger<IntegerType> = 0>
[[nodiscard]] Generator<IntegerType>
Integer(IntegerType minimum = std::numeric_limits<IntegerType>::lowest(),
IntegerType maximum = std::numeric_limits<IntegerType>::max())