This piece in PIConGPU seems to have been misunderstood and therefore misformatted by clang-format. I am not sure exactly why.
Admittedly, it is rather (and likely too) complicated anyhow. What is going on there:
ForEachIdx<IdxConfig<numCellsPerSuperCell, numWorkers>> is a functor type
- We instantiate an object of this type by passing
workerIdx to its constructor, so the curly brace at the end of line 398 is call for constructor, not start of a block
- Then we immediately call
operator() of the freshly constructed object in the same expression
- And pass a lambda defined just there as its argument
Edit: so what the code with the current formatting boils down to (line 398 and start of line 399) is
Type{
constructor parameter}( lots of other stuff ...
and I suspect the other stuff was complicated and it did not recognize the constructor parameter.
cc @j-stephan
This piece in PIConGPU seems to have been misunderstood and therefore misformatted by
clang-format. I am not sure exactly why.Admittedly, it is rather (and likely too) complicated anyhow. What is going on there:
ForEachIdx<IdxConfig<numCellsPerSuperCell, numWorkers>>is a functor typeworkerIdxto its constructor, so the curly brace at the end of line 398 is call for constructor, not start of a blockoperator()of the freshly constructed object in the same expressionEdit: so what the code with the current formatting boils down to (line 398 and start of line 399) is
and I suspect the other stuff was complicated and it did not recognize the constructor parameter.
cc @j-stephan