Commit Graph

1 Commits

Author SHA1 Message Date
William S Fulton cbe8b154f7 cpp20_concepts: add class methods and class template test cases
Two new test cases extend existing concept coverage from free function
templates to member function templates and class templates, with
matching Python and Java runme files.

cpp20_concepts_class_methods.i - member function templates of a
non-templated Calculator class:
  - cube<T>      trailing requires-clause
  - quad<T>      prefix requires-clause
  - sum<T>       static method, trailing requires with an inline
                 requires-expression as the constraint
  - addn<T>      prefix requires using a named concept whose body is
                 itself a requires-expression
  - scale<T,U>   two template parameters with a compound '&&' constraint

cpp20_concepts_classes.i - concepts on class templates:
  - NumericBox<T>   class template with a prefix requires-clause on
                    the template head
  - Holder<T>       unconstrained class whose ordinary method
                    (doubled()) carries its own trailing requires-clause
  - SmallBox<T>     class template with a compound '&&' prefix
                    requires-clause
  - CheckedBox<T>   unconstrained class template with a constrained
                    constructor

Both new test cases are registered in Examples/test suite/common.mk
under CPP20_TEST_CASES.

Assisted-by: Claude Code (Opus 4.7)
2026-05-10 17:37:52 +01:00