This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 58148 patch


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]