From Jason Turner

[diff.cpp14.special]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9i7m2feu/{from.md → to.md} +25 -0
tmp/tmp9i7m2feu/{from.md → to.md} RENAMED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Clause [[special]]: special member functions <a id="diff.cpp14.special">[[diff.cpp14.special]]</a>
2
+
3
+ [[class.inhctor.init]] **Change:** Inheriting a constructor no longer
4
+ injects a constructor into the derived class. **Rationale:** Better
5
+ interaction with other language features. **Effect on original
6
+ feature:** Valid C++14code that uses inheriting constructors may not be
7
+ valid or may have different semantics. A *using-declaration* that names
8
+ a constructor now makes the corresponding base class constructors
9
+ visible to initializations of the derived class rather than declaring
10
+ additional derived class constructors.
11
+
12
+ ``` cpp
13
+ struct A {
14
+ template<typename T> A(T, typename T::type = 0);
15
+ A(int);
16
+ };
17
+ struct B : A {
18
+ using A::A;
19
+ B(int);
20
+ };
21
+ B b(42L); // now calls B(int), used to call B<long>(long),
22
+ // which called A(int) due to substitution failure
23
+ // in A<long>(long).
24
+ ```
25
+