Optional<T&> paper soon

I’m gearing up for another rev of the optional<T&> paper, which means some reorg to keep wording in sync. Moving definitions out of line so the synopsis can be pulled out cleanly, using declarations for std:: names since the standard avoids the redundant scope, and a few other such things.
Since there are a handful of substantive changes under review, I’ll branch off that PR and rebase to pick up any additional changes.

1 Like

A few things will need to be back merged from my refref branch.

1 Like

A few thoughts:

  • 1.2 and 1.3 headings should be capitals
  • example 1.2
std::optional<Cat&> cat = find_cat("Fido");
cat.and_then([](Cat& thecat){/* ... */ }     //<-- missing paren
//alternate client code
find_cat("Fido").and_then([](Cat& thecat){/* ... */ });
  • “3.3 Construction of optional<T&> should be trivial… Boost is not.” - huh?
  • Does this need to be addressed? Optional Reference Binding - 1.86.0
  • wording: there’s an awful lot of unchanged context ( 3.2 - 3.7 and later .6 - .12) here that I’d delete so as to not confuse LWG that there might be some changes
  • wording: I don’t have time to look at it in detail right now
  • implementation in the paper – interesting…

I’ll fix the Caps in Headings. Spent too much time with a different tex package that did titlecase for me, leading to different problems, of course.

I haven’t figured what would need to change, but boost’s optional fails on the relevant is_trivial trait. Which also tells you something about just how important it is

I’ll add some test cases for Optional Reference Binding - 1.86.0 a few of them at least are made ill formed in some way.

I can drop the unchanged bits when it gets to LWG, keeping it for LEWG because not changing all that is part of the design, and a couple tiny bits did change. Also started with copying the relevant chunk from draft/source/utilities.tex so actual diffs are pretty easy, but latexdiff doesn’t like it.

1 Like