Created on 2012-08-06.00:00:00 last changed 131 months ago
[Moved to DR at the April, 2013 meeting.]
Proposed resolution (October, 2012):
Change 13.7.4 [temp.variadic] paragraph 4 as follows:
...Pack expansions can occur in the following contexts:
...
In a mem-initializer-list (11.9.3 [class.base.init]) for a mem-initializer whose mem-initializer-id denotes a base class; the pattern is
athe mem-initializer....
The list of pack expansion contexts in 13.7.4 [temp.variadic] paragraph 4 includes a mem-initializer-list, with no restriction on whether the mem-initializer corresponds to a base class or a member. However, it appears from 11.9.3 [class.base.init] paragraph 15 that such a pack expansion is intended for bases:
A mem-initializer followed by an ellipsis is a pack expansion (13.7.4 [temp.variadic]) that initializes the base classes specified by a pack expansion in the base-specifier-list for the class.
This is not conclusive, however, and use of a pack expansion with a mem-initializer for a member could be used with packs containing zero or one element:
class S { }; template<typename... T> class X { public: X(T ...args) : data_(args)... { } private: S data_; }; int main() { S s; X<> x1; X<S> x2(s); }
The Standard should be clarified as to whether such a usage is permitted or not.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: drwp -> cd3 |
2013-10-14 00:00:00 | admin | set | status: dr -> drwp |
2013-05-03 00:00:00 | admin | set | messages: + msg4425 |
2013-05-03 00:00:00 | admin | set | status: ready -> dr |
2012-11-03 00:00:00 | admin | set | messages: + msg4069 |
2012-11-03 00:00:00 | admin | set | status: open -> ready |
2012-08-06 00:00:00 | admin | create |