Created on 2002-07-29.00:00:00 last changed 197 months ago
[Voted into WP at October 2003 meeting.]
Proposed resolution (October 2002):
Add after the fourth-to-last bullet of 13.10.3 [temp.deduct] paragraph 2:
- Attempting to give an invalid type to a nontype template parameter. [Example:
template <class T, T> struct S {}; template <class T> int f(S<T, T()>*); struct X {}; int i0 = f<X>(0);]
I understand the rules in 13.10.3 [temp.deduct] paragraph 2 are meant to be an exhaustive list of what can cause type deduction to fail.
Consider:
template<typename U,U u> struct wrap_t; template<typename U> static yes check( wrap_t<U,U(0)>* ); struct X { X(int); }; int main() { check<X>(0); }
I can see 2 reasons this might cause type deduction to fail:
Neither case is mentioned in 13.10.3 [temp.deduct] paragraph 2, nor do I see a DR mentioning these.
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2004-04-09 00:00:00 | admin | set | messages: + msg1026 |
2003-11-15 00:00:00 | admin | set | status: ready -> wp |
2003-04-25 00:00:00 | admin | set | status: review -> ready |
2002-11-08 00:00:00 | admin | set | messages: + msg744 |
2002-11-08 00:00:00 | admin | set | status: open -> review |
2002-07-29 00:00:00 | admin | create |