MCPcopy Create free account
hub / github.com/apache/trafficserver / FilterGenerator

Method FilterGenerator

lib/catch2/catch.hpp:4161–4173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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