D0187R1: Wording for New Bit-field Syntax

113 views
Skip to first unread message

Andrew Tomazos

unread,
Sep 13, 2016, 2:06:07 AM9/13/16
to std-pr...@isocpp.org
Please find attached D0187R1 Wording for New Bit-field Syntax.

Feedback appreciated.

Thanks,
Andrew.

D0187R1.pdf

D. B.

unread,
Sep 13, 2016, 2:18:42 AM9/13/16
to std-pr...@isocpp.org
What were the responses to the parsing ambiguity/suggested rules in the previous paper? You're right that there were theoretical issues, and that's probably enough, though one would really have to try to produce examples that tripped it, which I'd hope would not appear in real code anyway. :D Again, probably the mere potential for ambiguity was enough to put people off the old syntax, but I'm interested in confirmation.

mihailn...@gmail.com

unread,
Sep 20, 2016, 6:19:23 AM9/20/16
to ISO C++ Standard - Future Proposals
From pure user perspective, the user will never ever guess to write a second colon without being told or he looked it up. 

In the R0, chances a new user to guess the syntax are well over 50% across all users, probably much much higher. 

In this, R1, the option to use both syntaxes gets you consistency. 
Though I personally use both syntaxes and appreciate the consistency, I am not sure introducing a new construct, is worth it. 

All things being equal however (if they really are), the first syntax has a slight edge in my view, but I don't hold a strong opinion on that. 

Arthur O'Dwyer

unread,
Sep 20, 2016, 8:27:08 PM9/20/16
to ISO C++ Standard - Future Proposals
On Monday, September 12, 2016 at 11:06:07 PM UTC-7, Andrew Tomazos wrote:
Please find attached D0187R1 Wording for New Bit-field Syntax.


Your paper just says "For background on the problem see P0187R0."  No; you need to repeat the motivation in this paper too. Otherwise, the syntax just looks dumb: nobody would ever want your proposed syntax over something obvious like

    struct S {
        unsigned flag : 1 = true;
        unsigned padding : 31 {};
    };

I'm guessing that P0187R0 must have had some discussion of a grammatical ambiguity raised by the above syntax. You need to repeat the explanation of that ambiguity in D0187R1, to stop people (such as myself) from complaining that you're proposing a dumb-looking syntax without explaining why it's needed.

HTH,
–Arthur

Nicol Bolas

unread,
Sep 21, 2016, 12:09:41 AM9/21/16
to ISO C++ Standard - Future Proposals
On Tuesday, September 20, 2016 at 8:27:08 PM UTC-4, Arthur O'Dwyer wrote:
On Monday, September 12, 2016 at 11:06:07 PM UTC-7, Andrew Tomazos wrote:
Please find attached D0187R1 Wording for New Bit-field Syntax.

Your paper just says "For background on the problem see P0187R0."  No; you need to repeat the motivation in this paper too.

There are plenty of papers where later revisions cull such background discussions. Indeed, many later revisions of papers cull everything except the standards wording.

That's not to say that the paper wouldn't necessarily be better if it retained that information. But it's hardly mandatory.

That being said, some papers that are wording-only get a new document number, rather than a revision number. Structured binding went from P0144 to P0217.
Reply all
Reply to author
Forward
0 new messages