You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear editors:
This paper is written in cppdraft-compatible LaTeX, so I copypasted the wording below, in case it helps. Also, I just noticed that, in the code example, my comments are somewhat inconsistent with the existing rest of the example: I use // OK, X deduced, while the existing code instead uses // OK, deduces X. Perhaps this inconsistency can be removed editorially.
In addition, if \tcode{C} satisfies the conditions for an aggregate class with the assumption that any dependent base class has no virtual functions and no virtual base classes, and the initializer is a non-empty \grammarterm{braced-init-list} or parenthesized \grammarterm{expression-list}, the set contains an additional function template, called the \grammarterm{aggregate deduction candidate}, defined as follows. Let $x_1, ..., x_n$ be the elements of the \grammarterm{initializer-list} or \grammarterm{designated-initializer-list} of the \grammarterm{braced-init-list}, or of the \grammarterm{expression-list}. For each $x_i$, let $e_i$ be the corresponding element of \tcode{C} or of one of its (possibly recursive) subaggregates that would be initialized by $x_i$ ([dcl.init.aggr]) if brace elision is not considered for any subaggregate that has a dependent type. If there is no such element $e_i$, the program is ill-formed. The aggregate deduction candidate is derived as above from a hypothetical constructor $\tcode{C}(\tcode{T}_1, ..., \tcode{T}_n)$, where $\tcode{T}_i$ is the declared type of the element $e_i$.
\begin{codeblock}
template <typename T>
struct S {
T x;
T y;
};
template <typename T>
struct C {
S<T> s;
T t;
};
template <typename T>
struct D {
S<int> s;
T t;
};
C c1 = {1, 2}; // error: deduction failed
C c2 = {1, 2, 3}; // error: deduction failed
C c3 = {{1u, 2u}, 3}; // OK, \tcode{C<int>} deduced
D d1 = {1, 2}; // error: deduction failed
D d2 = {1, 2, 3}; // OK, braces elided, \tcode{D<int>} deduced
template <typename T>
struct I {
using type = T;
};
template <typename T>
struct E {
typename I<T>::type i;
T t;
};
E e1 = {1, 2}; // OK, \tcode{E<int>} deduced
\end{codeblock}
No description provided.
The text was updated successfully, but these errors were encountered: