PR 58148 patch
Paolo Carlini
paolo.carlini@oracle.com
Mon Aug 26 20:40:00 GMT 2013
On 08/26/2013 09:44 PM, François Dumont wrote:
> Hi
>
> The problem exposed in PR 58148 is quite trivial, std::common_type
> cannot find a result when instantiated with char* and const wchar_t*.
> The attached patch will fix this problem by dealing with a
> std::common_type resolution failure even if the drawback is that
> following call won't be detected as an invalid one anymore:
>
> std::vector<int> v;
> ....
> v.insert(v.begin(), reinterpret_cast<char*>(v.data() + 1),
> reinterpret_cast<char*>(v.data() + 5)); // Expected failure
For the time being I think we should simply live with this. To be
honest, I think that at this level even the very idea of using
common_type (and relying on the very recent sfinae-friendly feature) is
a bit too much, I would just return true if the type of
addressof(*__other) != container::pointer (modulo const). Thus have a
__foreign_iterator_aux4 taking two container::const_pointer and a fall
back always returning true.
Paolo.
More information about the Libstdc++
mailing list