Before:
auto[a, b] = f();
After:
auto [a, b] = f();
or, if SpacesInSquareBrackets is true:
auto [ a, b ] = f();
Differential D37132
[clang-format] Add support for C++17 structured bindings. curdeius on Aug 25 2017, 1:08 AM. Authored by
Details Before: auto[a, b] = f(); After: auto [a, b] = f(); or, if SpacesInSquareBrackets is true: auto [ a, b ] = f();
Diff Detail
Event TimelineComment Actions Are you changing the line endings here? Phabricator tells me that basically all the lines change. If so, please don't ;).
Comment Actions Thanks for this change. This outputs a space before and after "&" or "&&", like this "auto & [...", "auto && [..." Could we remove one of the space to a format like the following? "auto& [...", "auto&& [..." Comment Actions Please review https://reviews.llvm.org/D35743. |
I'd prefer to move this into a separate function or a lambda, i.e.: