Instead of usual
void foo (void ) {
cout << "Meaning of life: " << 42 << endl;
}
C++11
allows is an alternative, using the Trailing Return
auto bar (void) -> void {
cout << "More meaning: " << 43 << endl;
}
In the latter - what is auto
designed to represent?
Another example, consider function
auto func (int i) -> int (*)[10] {
}
Same question, what is the meaning of auto
in this example?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…