| 1800 | |
| 1801 | template <typename Pattern, typename Pred> |
| 1802 | class PostCheck |
| 1803 | { |
| 1804 | public: |
| 1805 | constexpr explicit PostCheck(Pattern const &pattern, Pred const &pred) |
| 1806 | : mPattern{pattern}, mPred{pred} {} |
| 1807 | constexpr bool check() const { return mPred(); } |
| 1808 | constexpr auto const &pattern() const { return mPattern; } |
| 1809 | |
| 1810 | private: |
| 1811 | Pattern const mPattern; |
| 1812 | Pred const mPred; |
| 1813 | }; |
| 1814 | |
| 1815 | template <typename Pattern, typename Pred> |
| 1816 | class PatternTraits<PostCheck<Pattern, Pred>> |