Skip to content

Commit d19349d

Browse files
committed
Add rules to allow omission of certain default values
1 parent 5e6c780 commit d19349d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

working/augmentation-libraries/feature-specification.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,8 @@ It's a **compile-time** error if:
733733
matching] the signature of the augmented function.
734734

735735
* The augmenting function specifies any default values. *Default values are
736-
defined solely by the introductory function.*
736+
defined solely by the introductory function. Note that constructors are
737+
treated differently from other functions in this respect.*
737738

738739
* A function is not complete after all augmentations are applied, unless it
739740
is in a context where it can be abstract. *Every function declaration
@@ -840,13 +841,21 @@ Augmenting constructors works similar to augmenting a function, with some extra
840841
rules to handle features unique to constructors like redirections and
841842
initializer lists.
842843

844+
It is **not** a compile-time error for an incomplete factory constructor to
845+
omit default values. *That is, they are treated similarly to abstract
846+
instance methods in this respect. This allows the augmenting declaration to
847+
implement the constructor by adding a redirection or a body.*
848+
843849
It's a **compile-time error** if:
844850

845851
* The signature of the augmenting function does not [match][signature
846852
matching] the signature of the augmented function.
847853

848-
* The augmenting constructor parameters specify any default values.
849-
*Default values are defined solely by the introductory constructor.*
854+
* The augmenting constructor parameters specify any default values,
855+
and the constructor is a non-redirecting factory. *Default values are
856+
defined by the introductory constructor, except when this precludes the
857+
augmentation from choosing whether or not the constructor should be
858+
redirecting.*
850859

851860
* The introductory constructor is `const` and the augmenting constructor
852861
is not or vice versa. *An augmentation can't change whether or not a

0 commit comments

Comments
 (0)