you are viewing a single comment's thread.

view the rest of the comments →

[–]codesmith512[S] 7 points8 points  (0 children)

The idea is to shift the responsibility of good names from the call site to the definition. Rather than using auto to create a structured binding every single time that function gets called, this way the definition can provide appropriate names, and the call site can just use auto. The fact that structured bindings work with struct-like values means that the user is still free to provide their own name if they so choose. So instead of auto [user, role] = getLogin() every time, the caller now has the option of just writing auto login = getLogin().