mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Move all<int> to .cpp file to remove <limits> from common path
This commit is contained in:
parent
fdcd46420e
commit
92e25049cf
@ -9,6 +9,7 @@
|
|||||||
#include "catch_random_number_generator.h"
|
#include "catch_random_number_generator.h"
|
||||||
#include "catch_interfaces_capture.h"
|
#include "catch_interfaces_capture.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
@ -40,6 +41,10 @@ namespace Generators {
|
|||||||
return getResultCapture().acquireGeneratorTracker( lineInfo );
|
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 Generators
|
||||||
} // namespace Catch
|
} // namespace Catch
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@ -123,16 +122,14 @@ namespace Generators {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
auto all() -> Generator<T> { return RequiresASpecialisationFor<T>(); }
|
auto all() -> Generator<T> { return RequiresASpecialisationFor<T>(); }
|
||||||
|
|
||||||
|
template<>
|
||||||
|
auto all<int>() -> Generator<int>;
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
auto range( T const& first, T const& last ) -> Generator<T> {
|
auto range( T const& first, T const& last ) -> Generator<T> {
|
||||||
return Generator<T>( (last-first), pf::make_unique<RangeGenerator<T>>( first, last ) );
|
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>
|
template<typename T>
|
||||||
auto random( T const& first, T const& last ) -> Generator<T> {
|
auto random( T const& first, T const& last ) -> Generator<T> {
|
||||||
|
Loading…
Reference in New Issue
Block a user