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

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-10-09 14:51:24 +0200
committerMartin Hořeňovský2019-10-09 14:51:36 +0200
commitc8db4e77c4c9aa20776db162e982f1af693ab8fe (patch)
tree738b92425aa18c49a4da7d2302dd10d6663b7ad7 /include
parent1c5749669e85239ce3dd3bb80028d9b8d2402787 (diff)
downloadcatch3-c8db4e77c4c9aa20776db162e982f1af693ab8fe.tar.gz
Add a from_range(Container) overload to the generator helpers
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_generators_specific.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/internal/catch_generators_specific.hpp b/include/internal/catch_generators_specific.hpp
index 0734ee78..f57d29b6 100644
--- a/include/internal/catch_generators_specific.hpp
+++ b/include/internal/catch_generators_specific.hpp
@@ -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