Can C++ concepts be used to replace all appearances of the keyword template
(apart from the concept's own declaration)?
I'm curious if there is any reason one would still need to use the keyword template
for other language constructs such as templated classes or templated functions. The only exception I can think of, are templated type aliases. Using templates for compile time calculations would be replaceable through constexpr
functions.
To keep my question brief,
What can regular template declarations do, that the adoption of concepts + constexpr can't replace?
template
would still be required for explicit instantiations
template some_class<int>;
and disambiguating dependent member templates
obj.template fun<T>();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With