This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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


Hi,

On 08/29/2013 09:37 PM, François Dumont wrote:
Indeed, I check the Standard about const_pointer, so here is another attempt.

Tested under Linux x86_64.

2013-08-29  François Dumont  <fdumont@gcc.gnu.org>

    PR libstdc++/58148
    * include/debug/functions.h (__foreign_iterator_aux4): Use
    sequence const_pointer as common type to compare pointers. Add a
    fallback overload in case pointers cannot be cast to sequence
    const_pointer.
    * testsuite/23_containers/vector/modifiers/insert/58148.cc: New.

Ok to commit ?
Seems pretty good to me. I have been thinking: when the non-trivial __foreign_iterator_aux4 is selected it actually has available as the last two arguments

    std::addressof(*(__it._M_get_sequence()->_M_base().begin()))
    std::addressof(*__other)

we could as well give the parameters names and avoid passing __other. Also, I think we can do everything with std::less. I'm attaching below something I quickly hacked, untested, see if you like it in case commit something similar.

Thanks!
Paolo.

//////////////////////

Attachment: p
Description: Text document


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