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

Method FilterGenerator

tutorials/external/catch.hpp:3739–3751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3737 public:
3738 template <typename P = Predicate>
3739 FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
3740 m_generator(std::move(generator)),
3741 m_predicate(std::forward<P>(pred))
3742 {
3743 if (!m_predicate(m_generator.get())) {
3744 // It might happen that there are no values that pass the
3745 // filter. In that case we throw an exception.
3746 auto has_initial_value = next();
3747 if (!has_initial_value) {
3748 Catch::throw_exception(GeneratorException("No valid value found in filtered generator"));
3749 }
3750 }
3751 }
3752
3753 T const& get() const override {
3754 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