Hacker News new | ask | show | jobs
by quietbritishjim 652 days ago
> Yes exactly.

Yes exactly, my example would work?

> My hunch is to remember that in `auto [to, ec] = std::to_chars(p, last, 42)` the two names `to` and `ec` are not "real" variables/objects, but ...

Oh so my example wouldn't work after all (because std::string s is a "real" variable/object)?

1 comments

Your example wouldn't work, yes.

In case of structured binding

  The decision variable of the declaration is the invented variable e introduced by the declaration.
 
but in your case its simply:

  The decision variable of the declaration is the declared variable.