| 4781 | public: |
| 4782 | template<typename P = Predicate> |
| 4783 | FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator) |
| 4784 | : m_generator(std::move(generator)) |
| 4785 | , m_predicate(std::forward<P>(pred)) |
| 4786 | { |
| 4787 | if (!m_predicate(m_generator.get())) |
| 4788 | { |
| 4789 | // It might happen that there are no values that pass the |
| 4790 | // filter. In that case we throw an exception. |
| 4791 | auto has_initial_value = next(); |
| 4792 | if (!has_initial_value) |
| 4793 | { |
| 4794 | Catch::throw_exception(GeneratorException("No valid value found in filtered generator")); |
| 4795 | } |
| 4796 | } |
| 4797 | } |
| 4798 | |
| 4799 | T const& get() const override |
| 4800 | { |
nothing calls this directly
no test coverage detected