C++ Logo

STD-PROPOSALS

Advanced search

Subject: [std-proposals] Proposal - Allow '.' operator to work on pointers (again sortof)
From: J Decker (d3ck0r_at_[hidden])
Date: 2020-03-04 18:44:28


Reformatted this to resemble standard proposal

https://gist.github.com/d3x0r/f496d0032476ed8b6f980f7ed31280da
It fails to be ' The proposal may be in PDF, HTML, or plain text formats. '

TL;DR

C Standard section 6.5.2.3 Structure and union members

add text in [ ]

1- The first operand of the . operator shall have a qualified or
unqualified structure or union type or [‘‘pointer to qualified or
unqualified structure’’ or ‘‘pointer to qualified or unqualified union’’,]
and the second operand shall name a member of that type.

C++ Standard section 8.5.1.5 Class member access

add: if the first expression of (dot) is a pointer [to an object], then
E1.E2 is converted to (*(E1)).E2 .

J



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups