Created on 2016-03-21.00:00:00 last changed 94 months ago
Notes from the December, 2016 teleconference:
The problem is that the current wording only connects name lookup with point of instantiation; other semantic checks, such as the requirement for completeness of a class, should also be performed at that point.
Consider:
template<class T> struct A { T* p; A(); ~A() { if (0 < sizeof (T)) delete p; } }; struct U; struct C { C(); ~C(); A<U> u; }; int main() { C c; return 0; }
The intent is that A<U>::~A is instantiated where the special member functions of C are defined (at which point U is ostensibly complete). Preventing instantiation (and thus avoiding the completeness check) in the present translation unit is necessary for the unique_ptr-based pimpl idiom to work.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | messages: + msg5836 |
2016-03-21 00:00:00 | admin | create |