MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / FilterGenerator

Method FilterGenerator

extlibs/catch/include/catch/catch.hpp:4058–4070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4056 public:
4057 template <typename P = Predicate>
4058 FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
4059 m_generator(std::move(generator)),
4060 m_predicate(std::forward<P>(pred))
4061 {
4062 if (!m_predicate(m_generator.get())) {
4063 // It might happen that there are no values that pass the
4064 // filter. In that case we throw an exception.
4065 auto has_initial_value = next();
4066 if (!has_initial_value) {
4067 Catch::throw_exception(GeneratorException("No valid value found in filtered generator"));
4068 }
4069 }
4070 }
4071
4072 T const& get() const override {
4073 return m_generator.get();

Callers

nothing calls this directly

Calls 3

throw_exceptionFunction · 0.85
GeneratorExceptionClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected