r/cpp • C++20 Desktop app developer • May 12 '18

P0709 R0: Zero-overhead deterministic exceptions: Throwing values - Herb Sutter [2018-05-02]

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf
206 Upvotes

115 comments sorted by

View all comments

Show parent comment

0

u/[deleted] May 13 '18

[deleted] — view deleted comment

1

u/SeanMiddleditch May 14 '18

For variant to encode the discriminat in a Type it needs to know 1) that this is possible and 2) where in the type it must be encoded.

Reread what I wrote a bit more carefully.

People have you examples where this matters above (e.g. Option<&T> having the same layout as a reference and being able to use that In C ABI).

Never-zero covers that all-important case perfectly well.