Interfaces
I.9
If an interface is a template, document its parameters using concepts
Reason
Make the interface precisely specified and compile-time checkable in the (not so distant) future.
Example
Use the C++20 style of requirements specification. For example:
template<typename Iter, typename Val>
requires input_iterator<Iter> && equality_comparable_with<iter_value_t<Iter>, Val>
Iter find(Iter first, Iter last, Val v)
{
// ...
}
See also: Generic programming and concepts.
Enforcement
Warn if any non-variadic template parameter is not constrained by a concept (in its declaration or mentioned in a requires clause).