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: std::bind vs ::bind ambiguity


On 25 April 2011 19:11, Jonathan Wakely wrote:
>
> Here's a patch which removes std::bind from the overload set when the
> first argument is "socketlike" which I've defined as is_integral ||
> is_enum. ?I considered using is_convertible to int to detect
> "socketlike" types, but a callable class type could be a valid
> argument to std::bind and also have implicit conversion to int.
> Another option is to constrain std::bind to function
> pointers/references, pointers to members, class types and pointers or
> references to class types ... but that's quite a lengthy list!
>
> The patch also renames the template parameters Functor to Func (in my
> book "functor" means a callable class, but the parameter could be a
> function pointer instead) and ArgTypes to BoundArgs (to match the name
> in the standard.)
>

The version I've checked in is attached. Compared to the previous
patch this removes the definition of the static const member, which as
Paolo pointed out is not needed.

2011-05-03  Jonathan Wakely  <jwakely.gcc@gmail.com>

        * include/std/functional (bind): Remove from overload set when first
        argument type might be a socket file descriptor.
        * testsuite/20_util/bind/socket.cc: New.

Tested x86_64-linux and committed to trunk

Attachment: bind_sfinae-2.txt
Description: Text document


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