@@ -567,26 +567,26 @@ $(GNAME Postblit):
567
567
---
568
568
569
569
$(P Depending on the struct layout, the compiler may generate the following
570
- internal postblits :)
570
+ internal postblit functions :)
571
571
572
572
$(OL
573
- $(LI `__postblit`. The compiler assigns this name to the explicitly
573
+ $(LI `void __postblit() `. The compiler assigns this name to the explicitly
574
574
defined postblit `this(this)` so that it can be treated exactly as
575
575
a normal function. Note that if a struct defines a postblit, it cannot
576
576
define a function named `__postblit` - no matter the signature -
577
- as this will result in a compilation error due to the name conflict.)
578
- $(LI `__fieldPostblit`. If a struct `X` has at least 1 member which is a
579
- struct that defines a postblit, then a field postblit is generated
580
- for `X` that calls all the underlying postblits of the struct fields
581
- in topological order.)
582
- $(LI `__aggrPostblit`. If a struct has an explicitly defined postblit
583
- and at least 1 struct member that has a postblit (any type of postblit )
577
+ as this would result in a compilation error due to the name conflict.)
578
+ $(LI `void __fieldPostblit() `. If a struct `X` has at least one `struct`
579
+ member that in turn defines (explicitly or implicitly) a postblit, then a field
580
+ postblit is generated for `X` that calls all the underlying postblits
581
+ of the struct fields in declaration order.)
582
+ $(LI `void __aggrPostblit() `. If a struct has an explicitly defined postblit
583
+ and at least 1 struct member that has a postblit (explicit or implicit )
584
584
an aggregated postblit is generated which calls `__fieldPostblit` first
585
585
and then `__postblit`.)
586
- $(LI `__xpostblit`. The field and aggregated postblits, although generated
587
- for a struct, are not actual struct members. In order to be able to call
588
- them, the compiler internally creates an alias, called `__xpostblit` which
589
- is a member of the struct and which points to the generated postblit that
586
+ $(LI `void __xpostblit() `. The field and aggregated postblits, although
587
+ generated for a struct, are not actual struct members. In order to be able
588
+ to call them, the compiler internally creates an alias, called `__xpostblit`
589
+ which is a member of the struct and which points to the generated postblit that
590
590
is the most inclusive.)
591
591
)
592
592
@@ -660,8 +660,8 @@ void main()
660
660
---
661
661
)
662
662
663
- $(P Postblits are not overloadable. If 2 postblits are defined,
664
- even if the signatures differ, the compiler will assign the
663
+ $(P Postblits are not overloadable. If two or more postblits are defined,
664
+ even if the signatures differ, the compiler assigns the
665
665
`__postblit` name to both and later issue a conflicting function
666
666
name error:)
667
667
@@ -673,14 +673,13 @@ struct X
673
673
}
674
674
---
675
675
676
- $(P The following paragraph describes the behavior of the
677
- postblit in the presence of qualifiers :)
676
+ $(P The following describes the behavior of the
677
+ qualified postblit definitions :)
678
678
679
679
$(OL
680
680
$(LI `const`. When a postblit is qualified with `const` as in
681
- $(D this(this) const;) or $(D const this(this);) the code is
682
- ill-formed. The postblit is succesfully called on `mutable`
683
- (due to the mutable to const implicit conversion), `const`
681
+ $(D this(this) const;) or $(D const this(this);) then the postblit
682
+ is succesfully called on mutable (unqualified), `const`,
684
683
and `immutable` objects, but the postblit cannot modify the object
685
684
because it regards it as `const`; hence `const` postblits are of
686
685
limited usefulness. Example:)
0 commit comments