I'm sure everything is in order. If I understand correctly, lambda will return an object of type char[12]
as a temporary one (from automatically subtracting the return type). This temporary can then be passed to another function, in this case operator<<()
.
This potentially means that copies are made, but RVO can take care of that.
UPDATE
As noted in the comments and in the best answer provided by TC, the return type received by this lambda is actually char *, not char [12]. I confirmed this with code in GCC.
source share