MCPcopy Create free account
hub / github.com/RenderKit/oidn / FilterGenerator

Method FilterGenerator

external/catch.hpp:4159–4171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4157 public:
4158 template <typename P = Predicate>
4159 FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
4160 m_generator(std::move(generator)),
4161 m_predicate(std::forward<P>(pred))
4162 {
4163 if (!m_predicate(m_generator.get())) {
4164 // It might happen that there are no values that pass the
4165 // filter. In that case we throw an exception.
4166 auto has_initial_value = next();
4167 if (!has_initial_value) {
4168 Catch::throw_exception(GeneratorException("No valid value found in filtered generator"));
4169 }
4170 }
4171 }
4172
4173 T const& get() const override {
4174 return m_generator.get();

Callers

nothing calls this directly

Calls 4

nextFunction · 0.85
throw_exceptionFunction · 0.85
GeneratorExceptionClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected