Justification for reusing "&&" - token for rvalue reference?

I recently gave a presentation in C ++ 11, mainly focusing on rvalues ​​and move semantics. During the presentation, the question arose of why the standard committee decided to reuse the & sign instead of introducing a new one, for example, Β§.

Has anyone found an explanation for reusing & <

+6
source share
1 answer

The committee needs a token, which is located on the American keyboard. We also needed something that wouldn't break the existing code. && seemed like an obvious token. We also looked for minimal changes to the standard, and the idea of ​​reusing a token instead of inventing a new one was attractive.

I credit John Spizer (EDG) with the first && offering as a token at an April 2002 meeting in Curacao.

+11
source

Source: https://habr.com/ru/post/918924/


All Articles