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