In C ++ 11, there are no return type residues for functions. autois not the type of placeholder that should be inferred here. You can say that its meaning is overloaded.
For functions, autosimply means that the return type will be set as the return type. You cannot omit the final return, or your program will be poorly formed.
, . "" .
, :
namespace baz {
struct foo {
enum bar {SOMETHING};
bar func();
};
}
- ++ 03, :
baz::foo::bar baz::foo::func() {
return SOMETHING;
}
. . :
auto baz::foo::func() -> bar {
return SOMETHING;
}
, bar .