| 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(); |
nothing calls this directly
no test coverage detected