C++11 introduced a new syntax for function declaration,
auto func(T rhs, U lhs) -> V
This was to solve some problems that appeared in the old C++ standard with function templates. Read this short Wikipedia article section for details about the problem:
> http://en.wikipedia.org/wiki/C%2B%2B11#Alternative_function_syntax
My question is, does D confront with the same problem? If so, how does it fix it (if at all)?
In D, the compiler can deduce the return type for you. So there’s no need to have the
-> Vsyntax.or if you want to be more specific (but it’s better to let the compiler figure out the type with
auto!)Like C++, you cannot use
typeof(lhs + rhs)in that place.