@Axel I found that structured binding seems not to be working under ROOT’s prompt or in a macro, but does work when using it in ACLiC or as a script.
For example:
▶ root -l
root [0] auto [a, b] = tuple(1, 2)
(std::tuple<int, int> &) { 1, 2 }
root [1] a
input_line_11:2:3: error: use of undeclared identifier 'a'
(a)
^
Error in <HandleInterpreterException>: Error evaluating expression (a).
Execution of your code was aborted.
//macro.cpp
//{
// auto [a, b] = tuple(1, 2);
// cout << a << endl;
//}
▶ root -l
root [0] .x macro.cpp
<ROOT crash>
But this does work
//script.cpp
//void script() {
//{
// auto [a, b] = tuple(1, 2);
// cout << a << endl;
//}
▶ root -l
root [0] .x script.cpp
1
Am I doing anything wrong? This would be a useful feature to reduce the number of lines I write in the prompt.