Re:The C++14 Standard: What You Need to Know
by nanofortnight on Wednesday September 17, 2014 @04:03PM
(#8332081)
Inferrence isn't magic and has sensible limits.
To quote:
> Of course, this requires the function body to be visible.
https://isocpp.org/wiki/faq/cpp14-language#generalized-retur...
Say I have a header file "foo.h" with an "auto foo();" declaration. Another file (eg, "bar.h") imports foo.h. How can the compiler do type checking when compiling bar.cc without also parsing foo.cc to determine the return type of foo()?