RippeR37/libbase

Cannot bind const member function

RippeR37 opened this issue · 1 comments

Current base::Bind*() implementation doesn't work with pointers to const member functions (either with raw/unretained pointers or weak pointers).

Example code that won't compile:

struct Foo {
  void Bar() const {};
};

void test() {
  Foo foo;
  base::BindOnce(&Foo::Bar, &foo);  // <-- compilation error
}

Probably similar thing happens with volatile qualifier.

Implemented.