diff options
| author | Martin Hořeňovský | 2018-08-23 12:49:05 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2018-08-24 13:34:03 +0200 |
| commit | 92e25049cf94574a8d344beb904cd2f75ffb5fc8 (patch) | |
| tree | 448afc8d68a12a09c709f67f87d8b946c0f44111 /include | |
| parent | fdcd46420e1ffbc4fcc33f91644a1da66b1e3c32 (diff) | |
| download | catch3-92e25049cf94574a8d344beb904cd2f75ffb5fc8.tar.gz | |
Move all<int> to .cpp file to remove <limits> from common path
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_generators.cpp | 5 | ||||
| -rw-r--r-- | include/internal/catch_generators.hpp | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/internal/catch_generators.cpp b/include/internal/catch_generators.cpp index caf5a0df..786da736 100644 --- a/include/internal/catch_generators.cpp +++ b/include/internal/catch_generators.cpp @@ -9,6 +9,7 @@ #include "catch_random_number_generator.h" #include "catch_interfaces_capture.h" +#include <limits> #include <set> namespace Catch { @@ -40,6 +41,10 @@ namespace Generators { return getResultCapture().acquireGeneratorTracker( lineInfo ); } + template<> + auto all<int>() -> Generator<int> { + return range( std::numeric_limits<int>::min(), std::numeric_limits<int>::max() ); + } } // namespace Generators } // namespace Catch diff --git a/include/internal/catch_generators.hpp b/include/internal/catch_generators.hpp index 26a310c2..74fa5922 100644 --- a/include/internal/catch_generators.hpp +++ b/include/internal/catch_generators.hpp @@ -13,7 +13,6 @@ #include <memory> #include <vector> #include <cassert> -#include <limits> #include <utility> @@ -123,16 +122,14 @@ namespace Generators { template<typename T> auto all() -> Generator<T> { return RequiresASpecialisationFor<T>(); } + template<> + auto all<int>() -> Generator<int>; + template<typename T> auto range( T const& first, T const& last ) -> Generator<T> { return Generator<T>( (last-first), pf::make_unique<RangeGenerator<T>>( first, last ) ); } - template<> - inline auto all<int>() -> Generator<int> { - return range( std::numeric_limits<int>::min(), std::numeric_limits<int>::max()-1 ); - } - template<typename T> auto random( T const& first, T const& last ) -> Generator<T> { |