| 4110 | public: |
| 4111 | template <typename P = Predicate> |
| 4112 | FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator): |
| 4113 | m_generator(std::move(generator)), |
| 4114 | m_predicate(std::forward<P>(pred)) |
| 4115 | { |
| 4116 | if (!m_predicate(m_generator.get())) { |
| 4117 | // It might happen that there are no values that pass the |
| 4118 | // filter. In that case we throw an exception. |
| 4119 | auto has_initial_value = next(); |
| 4120 | if (!has_initial_value) { |
| 4121 | Catch::throw_exception(GeneratorException("No valid value found in filtered generator")); |
| 4122 | } |
| 4123 | } |
| 4124 | } |
| 4125 | |
| 4126 | T const& get() const override { |
| 4127 | return m_generator.get(); |
nothing calls this directly
no test coverage detected