Skip to content

Commit 691bf5f

Browse files
committed
Add rules to allow omission of certain default values
1 parent baacbb1 commit 691bf5f

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
@@ -774,7 +774,8 @@ It's a **compile-time** error if:
774774
matching] the signature of the augmented function.
775775

776776
* The augmenting function specifies any default values. *Default values are
777-
defined solely by the introductory function.*
777+
defined solely by the introductory function. Note that constructors are
778+
treated differently from other functions in this respect.*
778779

779780
* A function is not complete after all augmentations are applied, unless it's
780781
an instance member and the surrounding class is abstract. *Every function
@@ -845,13 +846,21 @@ Augmenting constructors works similar to augmenting a function, with some extra
845846
rules to handle features unique to constructors like redirections and
846847
initializer lists.
847848

849+
It is **not** a compile-time error for an incomplete factory constructor to
850+
omit default values. *That is, they are treated similarly to abstract
851+
instance methods in this respect. This allows the augmenting declaration to
852+
implement the constructor by adding a redirection or a body.*
853+
848854
It's a **compile-time error** if:
849855

850856
* The signature of the augmenting function does not [match][signature
851857
matching] the signature of the augmented function.
852858

853-
* The augmenting constructor parameters specify any default values.
854-
*Default values are defined solely by the introductory constructor.*
859+
* The augmenting constructor parameters specify any default values,
860+
and the constructor is a non-redirecting factory. *Default values are
861+
defined by the introductory constructor, except when this precludes the
862+
augmentation from choosing whether or not the constructor should be
863+
redirecting.*
855864

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

0 commit comments

Comments
 (0)