Reading the answer for one exercise in C++ Primer, 5th Edition, I found this code:
#ifndef CP5_ex7_04_h #define CP5_ex7_04_h #include <string> class Person { std::string name; std::string address; public: auto get_name() const -> std::string const& { return name; } auto get_addr() const -> std::string const& { return address; } }; #endif What does
const -> std::string const& mean in this case?
auto func() -> type=type func(), but the first one has more features. In your case it has no advantages and was probably used because someone who wrote the code likes it more than the normal syntax.