1 | #include <boost/config.hpp> |
2 | |
3 | #if defined(BOOST_MSVC) |
4 | #pragma warning(disable: 4786) // identifier truncated in debug info |
5 | #pragma warning(disable: 4710) // function not inlined |
6 | #pragma warning(disable: 4711) // function selected for automatic inline expansion |
7 | #pragma warning(disable: 4514) // unreferenced inline removed |
8 | #endif |
9 | |
10 | // |
11 | // bind_dm3_test.cpp - data members (regression 1.31 - 1.32) |
12 | // |
13 | // Copyright (c) 2005 Peter Dimov |
14 | // |
15 | // Distributed under the Boost Software License, Version 1.0. (See |
16 | // accompanying file LICENSE_1_0.txt or copy at |
17 | // http://www.boost.org/LICENSE_1_0.txt) |
18 | // |
19 | |
20 | #if defined(BOOST_GCC) && BOOST_GCC >= 130000 && BOOST_GCC < 140000 |
21 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113256 |
22 | # pragma GCC diagnostic ignored "-Wdangling-reference" |
23 | #endif |
24 | |
25 | #include <boost/bind/bind.hpp> |
26 | #include <boost/core/lightweight_test.hpp> |
27 | #include <utility> |
28 | |
29 | using namespace boost::placeholders; |
30 | |
31 | // |
32 | |
33 | int main() |
34 | { |
35 | typedef std::pair<int, int> pair_type; |
36 | |
37 | pair_type pair( 10, 20 ); |
38 | |
39 | int const & x = boost::bind( f: &pair_type::first, a1: _1 )( pair ); |
40 | |
41 | BOOST_TEST( &pair.first == &x ); |
42 | |
43 | return boost::report_errors(); |
44 | } |
45 | |