Commit 84bde7b
committed
✨ Add
Problem:
- Sometimes it is useful to use fields that overlap: for instance to be able to
inspect individual bits _and_ have an overlapping field that represents the
set of bits as a whole. In these cases it is useful at construction time to
leave such an overlapping field uninitialized so that we don't have a scenario
where one initialization overwrites another.
Solution:
- Allow a field to be marked as `uninitialized` so that on construction it won't
potentially clobber other fields.
Note:
- The difference between `without_default` and `uninitialized` is that a field
marked `without_default` must still be given a value at construction time.uninitialized state for fields1 parent f701a01 commit 84bde7b
3 files changed
+26
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | 365 | | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
370 | 369 | | |
371 | 370 | | |
372 | | - | |
373 | 371 | | |
374 | 372 | | |
375 | 373 | | |
376 | 374 | | |
377 | | - | |
378 | 375 | | |
379 | 376 | | |
380 | 377 | | |
381 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
386 | | - | |
| 387 | + | |
| 388 | + | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
| |||
489 | 491 | | |
490 | 492 | | |
491 | 493 | | |
| 494 | + | |
| 495 | + | |
492 | 496 | | |
493 | 497 | | |
494 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
| 500 | + | |
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
| 510 | + | |
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
0 commit comments