File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 3022
3022
3023
3023
\pnum
3024
3024
\indextext {overloading!using-declaration and}%
3025
- For the purpose of overload resolution, the functions that are
3025
+ For the purpose of forming a set of candidates during overload resolution,
3026
+ the functions that are
3026
3027
introduced by a \grammarterm {using-declaration} into a derived class
3027
3028
are treated as though they were members of the derived class. In
3028
3029
particular, the implicit \tcode {this} parameter shall be treated as if
3037
3038
of an object of class type, all subobjects other than the base class
3038
3039
from which the constructor originated
3039
3040
are implicitly initialized~(\ref {class.inhctor.init }).
3041
+ \begin {note }
3042
+ A member of a derived class is sometimes preferred to a member of a base class
3043
+ if they would otherwise be ambiguous~(\ref {over.match.best }).
3044
+ \end {note }
3040
3045
3041
3046
\pnum
3042
3047
\indextext {access control!using-declaration and}%
Original file line number Diff line number Diff line change 1676
1676
according to the partial ordering rules described in~\ref {temp.func.order },
1677
1677
or, if not that,
1678
1678
1679
+ \item
1680
+ \tcode {F1} is a constructor for a class \tcode {D},
1681
+ \tcode {F2} is a constructor for a base class \tcode {B} of \tcode {D}, and
1682
+ for all arguments
1683
+ the corresponding parameters of \tcode {F1} and \tcode {F2} have the same type.
1684
+ \begin {example }
1685
+ \begin {codeblock }
1686
+ struct A {
1687
+ A(int = 0);
1688
+ };
1689
+
1690
+ struct B: A {
1691
+ using A::A;
1692
+ B();
1693
+ };
1694
+
1695
+ int main() {
1696
+ B b; // OK, \tcode {B::B()}
1697
+ }
1698
+ \end {codeblock }
1699
+ \end {example }
1700
+ or, if not that,
1701
+
1679
1702
\item
1680
1703
\tcode {F1} is generated from a
1681
1704
\grammarterm {deduction-guide}~(\ref {over.match.class.deduct })
You can’t perform that action at this time.
0 commit comments