MFH
MFH

Reputation: 1734

Rationale behind reuse of "&&"-token for rvalue reference?

I recently held a presentation on C++11, mainly focusing on rvalues and move semantics. During the presentation the question came up on why the standard committee decided to reuse the "&&"-token instead of introducing a new one like "§".

Has anyone came across the rationale for reusing &&?

Upvotes: 6

Views: 222

Answers (1)

Howard Hinnant
Howard Hinnant

Reputation: 218720

The committee wanted a token that is on a US keyboard. We also needed something that would not break existing code. && seemed like an obvious token to use. We were also looking for minimal changes to the standard and the idea of reusing a token instead of inventing a new one was attractive.

I credit John Spicer (EDG) with first suggesting && as the token at the April 2002 meeting in Curaçao.

Upvotes: 12

Related Questions