jensmaurer · GitHub

After extensive discussion about [[nodiscard]] policy in LEWG, it was agreed that [[nodiscard]] should not appear in the library wording (see SD-9). However, the wording removal paper, P2422R1 (approved in St. Louis, #7110), does not seem to remove all occurrences of [[nodiscard]] in the library clauses due to some recently added [[nodiscard]] annotation (such as those on flat containers’ empty()) being missed.

Therefore, this PR removes all occurrences of [[nodiscard]] in N4988. Those are:

  • 22.2.1 [utility.syn]
  • 24.6.9.2 [flat.map.defn]
  • 24.6.10.2 [flat.multimap.defn]
  • 24.6.11.2 [flat.set.defn]
  • 24.6.12.2 [flat.multiset.defn]
  • 24.7.3.6.1 [mdspan.mdspan.overview] and 24.7.3.6.3 [mdspan.mdspan.members]

After the change, the only mention of [[nodiscard]] in the standard is in examples and Core wording.

(I assumed that this is editorial since it seems likely that these are just missed by P2422's wording...)

Read the original on github.com ↗