
Paul A Bristow <pbristow@hetp.u-net.com> wrote: <snip>
PS The query was about an item which failed to compile using 8.0 (OK with 7.1)
template<typename T, typename BigT> out_sqr(ostream& os, T x, BigT temp) { temp = x * x; os << temp; }
Bray says that this is because the implicit function return type is int,
This is a non-standard extension for compatibility with a predecessor of C that was replaced over 30 years ago. It appals me that any current C++ compiler still supports it.
I assumed that the implicit function return type was void, and indeed if void is added, it works as expected.
C++ does not allow the return type to be implicit, and when it was allowed in C (prior to the 1999 standard) it was int.
Can anyone who has digested the Standard quote chapter and verse on this?
You're kidding, right?