(c++11) Why can std::bind be used without the std namespace prefix?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

it turns out that the std::bind template (since C++11) can be used
without the std:: namespace prefix ('ve tried 4.8.4, 8.3.0, 9.1.0).

But why?

That is, I fail to see how 'bind' can resolve to '::std::bind'
in this example, where one would expect a compilation failure:

#include <functional>
struct Object {
   int get42() { return 42; }
};
int doGet42(Object * o)
{
  return bind(&Object::get42, ::std::placeholders::_1)(o);
}

However, using '::bind' does fail as expected.

Thanks!
/haubi/



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux