Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop talking about fields #5544

Open
jwakely opened this issue Jun 30, 2022 · 3 comments · Fixed by #6479, #6481 or #6482 · May be fixed by #6480
Open

Stop talking about fields #5544

jwakely opened this issue Jun 30, 2022 · 3 comments · Fixed by #6479, #6481 or #6482 · May be fixed by #6480

Comments

@jwakely
Copy link
Member

jwakely commented Jun 30, 2022

[intro.memory] has a note that says "It is not safe to concurrently update two bit-fields in the same struct if all fields between them are also bit-fields of nonzero width." The term fields is not defined in the standard.

[support.srcloc.class.general] has a comment saying "source location field access" which is novel in the library clauses. We could say "access functions" or "member access" or just get rid of the comment. It has very little value. Either way, I don't think it needs to include "source location" in that comment or the one above the constructors. We know which class we're looking at.

[mem.res.pool.options] says "specified in this field" twice, which should be member.

[time.cal.ymd.overview] and adjacent subclauses uses "field-based time point" which I think means the mathematical meaning of the word, i.e. a set that supports arithmetic. It's arguable if this actually helps.

[time.hms.overview] says "The individual duration fields always return non-negative durations". I'm not sure what this means. It seems to be referring to the non-static data members h, m, and s (which have types that are specializations of duration) but what does it mean for them to "return" something? Does it mean the corresponding member functions? This could be improved.

All uses of "field" in iostreams, locales, and std::format are OK, it's talking about widths and padding of text fields, which seems fine. This isn't confusing, and matches the use of "field" in ISO C.

[diff.cpp20.utilities] says "bit fields" which should be hyphenated.

[diff.dcl] refers to "field initializers" which isn't defined in ISO C or ISO C++.

@jwakely
Copy link
Member Author

jwakely commented Jun 30, 2022

Oh and a footnote that says "Thus, the valarray template is neither a matrix class nor a field class." This is also the mathematical meaning.

C++98 was much better, it only had one anachronistic field: "The result of applying the offsetof macro to a field that is a static data member or a function member is undefined." That wording is no longer present, but we've introduced more fields elsewhere.

@Eisenwave
Copy link
Contributor

Eisenwave commented Aug 24, 2023

At the time of writing, the status is

Done

  • [intro.memory]
  • [mem.res.pool.options]
  • [diff.cpp20.utilities] MERGED
  • [diff.dcl]

Not done

  • [support.srcloc.class.general]
  • [time.cal.ymd.overview]
  • [time.hms.overview]

@jwakely
Copy link
Member Author

jwakely commented Aug 24, 2023

[time.cal.ymd.overview] and adjacent subclauses uses "field-based time point" which I think means the mathematical meaning of the word, i.e. a set that supports arithmetic. It's arguable if this actually helps.

This is actually using the terminology explained in https://howardhinnant.github.io/date/date.html#Overview which comes from N3344. But we shouldn't be using that terminology without defining it or adding a bibliography reference.

@jwakely jwakely reopened this Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment