educative.io

Educative

Is there a reason you didn't use the abbreviated function syntax here?

Is there a reason you didn’t use the abbreviated function syntax here? For example, this seems to me to be a cleaner solution:

auto sum(Arithmetic auto a, Arithmetic auto b) {
  return a + b;
}

Hi,

Using abbreviated function templates or restricted type parameters makes no big difference in this case.

However, there is a little downside of the abbreviated function templates: only Clang and GCC support it, but not the Microsoft compiler (cl.exe).