I see a lot of this kind of code statements in one of well known C++ unit test framework.
This is inline class member function.
auto exeName() const -> std::string {
return m_exeName;
}
What benefits does it give? Wouldn't it be the same to write
std::string exeName() const {
return m_exeName;
}
I understand what are benefits of trailing return type. But if function returns just string or int or other basic type why we can't just use well known syntax?