PageRenderTime 10ms CodeModel.GetById 7ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/libs/phoenix/test/boost_bind_compatibility/bind_dm3_test.cpp

http://hadesmem.googlecode.com/
C++ | 49 lines | 28 code | 13 blank | 8 comment | 3 complexity | 3c4444aa9ad28668c6aa0764862391ca MD5 | raw file
 1/*==============================================================================
 2    Copyright (c) 2005 Peter Dimov
 3    Copyright (c) 2005-2010 Joel de Guzman
 4    Copyright (c) 2010 Thomas Heller
 5
 6    Distributed under the Boost Software License, Version 1.0. (See accompanying
 7    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 8==============================================================================*/
 9
10#include <boost/config.hpp>
11
12#if defined(BOOST_MSVC)
13#pragma warning(disable: 4786)  // identifier truncated in debug info
14#pragma warning(disable: 4710)  // function not inlined
15#pragma warning(disable: 4711)  // function selected for automatic inline expansion
16#pragma warning(disable: 4514)  // unreferenced inline removed
17#endif
18
19#include <boost/phoenix/core.hpp>
20#include <boost/phoenix/bind.hpp>
21
22#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
23#pragma warning(push, 3)
24#endif
25
26#include <iostream>
27
28#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
29#pragma warning(pop)
30#endif
31
32#include <boost/detail/lightweight_test.hpp>
33#include <utility>
34
35int main()
36{
37    using boost::phoenix::bind;
38    using boost::phoenix::placeholders::_1;
39
40    typedef std::pair<int, int> pair_type;
41
42    pair_type pair( 10, 20 );
43
44    int const & x = bind( &pair_type::first, _1 )( pair );
45
46    BOOST_TEST( &pair.first == &x );
47
48    return boost::report_errors();
49}