Search notes:

C++ Standard Library:

//
//  g++ -std=c++11 mem_fn.cpp
//
#include <iostream>
#include <string>
#include <functional>

struct S {

  int member;

  void print(std::string const& prefix) {
    std::cout << prefix << ": " << member << std::endl;
  }

};

int main() {

  auto f = std::mem_fn(&S::print);

  S s1; s1.member = 42;
  S s2; s2.member = 99;

  f(s1, "s1");
  f(s2, "s2");

}
Github repository about-cpp-standard-library, path: /functional/mem_fn.cpp
Output:
s1: 42
s2: 99

See also

C++ Standard Library

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758194007, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/C-C-plus-plus/CPP-Standard-Library/functional/mem_fn(70): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78