我有以下代码:
This.is.a.supper.long.name = This.is.another.supper.long.name
Run Code Online (Sandbox Code Playgroud)
目前,我知道的唯一方法是转义换行符:
This.is.a.supper.long.name = \
This.is.another.supper.long.name
Run Code Online (Sandbox Code Playgroud)
有什么优雅的解决方案吗?
在 Python 中我们可以做到
for i, j in [(0, 0), (0, 1), (1, 0), (1, 1)]:
...
Run Code Online (Sandbox Code Playgroud)
C ++中有类似的东西吗?
在非嵌套的情况下有
for (auto i : {0, 1});
Run Code Online (Sandbox Code Playgroud)
但扩展到嵌套列表
for (auto [i, j] : {{0, 0}, {0, 1}, {1, 0}, {1, 1}});
Run Code Online (Sandbox Code Playgroud)
不编译。