• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//  (C) Copyright John Maddock 2017.
2//  Use, modification and distribution are subject to the
3//  Boost Software License, Version 1.0. (See accompanying file
4//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6//  See http://www.boost.org/libs/config for most recent version.
7
8//  MACRO:         BOOST_NO_CXX98_BINDERS
9//  TITLE:         std::bind1st, prt_fun and mem_fun
10//  DESCRIPTION:   The std lib has C++98 binders and adaptors.
11
12#include <functional>
13
14namespace boost_no_cxx98_binders{
15
16int f2(int a, int b) { return a + b; }
17
18struct A
19{
20   int f1(int a) { return a; }
21};
22
23
24int test()
25{
26   A a;
27   return std::bind1st(std::ptr_fun(f2), 0)(0) + std::bind1st(std::mem_fun(&A::f1), &a)(0);
28}
29
30}
31