Created on 2013-01-28.00:00:00 last changed 141 months ago
Notes from the April, 2013 meeting:
CWG agreed that the const should be preserved in the array type.
Given
template<class C> void foo(const C* val) {} template<int N> void foo(const char (&t)[N]) {}
it is intuitive that the second template is more specialized than the first. However, the current rules make them unordered. In 13.10.3.5 [temp.deduct.partial] paragraph 4, we have P as const C* and A as const char (&)[N]. Paragraph 5 transforms A to const char[N]. Finally, paragraph 7 removes top-level cv-qualification; since a cv-qualified array element type is considered to be cv-qualification of the array (6.8.5 [basic.type.qualifier] paragraph 5, cf issue 1059), A becomes char[N]. P remains const C*, so deduction fails because of the missing const in A.
History | |||
---|---|---|---|
Date | User | Action | Args |
2013-05-03 00:00:00 | admin | set | messages: + msg4351 |
2013-05-03 00:00:00 | admin | set | status: open -> drafting |
2013-01-28 00:00:00 | admin | create |