/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. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. ==============================================================================*/
  8. #include <boost/config.hpp>
  9. #if defined(BOOST_MSVC)
  10. #pragma warning(disable: 4786) // identifier truncated in debug info
  11. #pragma warning(disable: 4710) // function not inlined
  12. #pragma warning(disable: 4711) // function selected for automatic inline expansion
  13. #pragma warning(disable: 4514) // unreferenced inline removed
  14. #endif
  15. #include <boost/phoenix/core.hpp>
  16. #include <boost/phoenix/bind.hpp>
  17. #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
  18. #pragma warning(push, 3)
  19. #endif
  20. #include <iostream>
  21. #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
  22. #pragma warning(pop)
  23. #endif
  24. #include <boost/detail/lightweight_test.hpp>
  25. #include <utility>
  26. int main()
  27. {
  28. using boost::phoenix::bind;
  29. using boost::phoenix::placeholders::_1;
  30. typedef std::pair<int, int> pair_type;
  31. pair_type pair( 10, 20 );
  32. int const & x = bind( &pair_type::first, _1 )( pair );
  33. BOOST_TEST( &pair.first == &x );
  34. return boost::report_errors();
  35. }