mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
Add a from_range(Container) overload to the generator helpers
This commit is contained in:
@@ -161,6 +161,13 @@ GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) {
|
||||
return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(from, to));
|
||||
}
|
||||
|
||||
template <typename Container,
|
||||
typename ResultType = typename Container::value_type>
|
||||
GeneratorWrapper<ResultType> from_range(Container const& cnt) {
|
||||
return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(cnt.begin(), cnt.end()));
|
||||
}
|
||||
|
||||
|
||||
} // namespace Generators
|
||||
} // namespace Catch
|
||||
|
||||
|
Reference in New Issue
Block a user