| 479 | // MatchConstraint |
| 480 | |
| 481 | std::shared_ptr<MatchConstraint> MatchConstraint::Make( |
| 482 | std::function<bool(const std::vector<TypeHolder>&)> matches) { |
| 483 | class FunctionMatchConstraint : public MatchConstraint { |
| 484 | public: |
| 485 | explicit FunctionMatchConstraint( |
| 486 | std::function<bool(const std::vector<TypeHolder>&)> matches) |
| 487 | : matches_(std::move(matches)) {} |
| 488 | |
| 489 | bool Matches(const std::vector<TypeHolder>& types) const override { |
| 490 | return matches_(types); |
| 491 | } |
| 492 | |
| 493 | private: |
| 494 | std::function<bool(const std::vector<TypeHolder>&)> matches_; |
| 495 | }; |
| 496 | |
| 497 | return std::make_shared<FunctionMatchConstraint>(std::move(matches)); |
| 498 | } |
| 499 | |
| 500 | std::shared_ptr<MatchConstraint> DecimalsHaveSameScale() { |
| 501 | class DecimalsHaveSameScaleConstraint : public MatchConstraint { |
nothing calls this directly
no outgoing calls
no test coverage detected