ref_fn_test.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include <boost/config.hpp>
  2. #if defined(BOOST_MSVC)
  3. #pragma warning(disable: 4786) // identifier truncated in debug info
  4. #pragma warning(disable: 4710) // function not inlined
  5. #pragma warning(disable: 4711) // function selected for automatic inline expansion
  6. #pragma warning(disable: 4514) // unreferenced inline removed
  7. #endif
  8. // ref_fn_test.cpp: ref( f )
  9. //
  10. // Copyright (c) 2008 Peter Dimov
  11. //
  12. // Distributed under the Boost Software License, Version 1.0.
  13. // See accompanying file LICENSE_1_0.txt or copy at
  14. // http://www.boost.org/LICENSE_1_0.txt
  15. #include <boost/ref.hpp>
  16. #include <boost/detail/lightweight_test.hpp>
  17. void f0()
  18. {
  19. }
  20. void f1(int)
  21. {
  22. }
  23. void f2(int, int)
  24. {
  25. }
  26. void f3(int, int, int)
  27. {
  28. }
  29. void f4(int, int, int, int)
  30. {
  31. }
  32. void f5(int, int, int, int, int)
  33. {
  34. }
  35. void f6(int, int, int, int, int, int)
  36. {
  37. }
  38. void f7(int, int, int, int, int, int, int)
  39. {
  40. }
  41. void f8(int, int, int, int, int, int, int, int)
  42. {
  43. }
  44. void f9(int, int, int, int, int, int, int, int, int)
  45. {
  46. }
  47. #define BOOST_TEST_REF( f ) BOOST_TEST( &boost::ref( f ).get() == &f )
  48. int main()
  49. {
  50. int v = 0;
  51. BOOST_TEST_REF( v );
  52. BOOST_TEST_REF( f0 );
  53. BOOST_TEST_REF( f1 );
  54. BOOST_TEST_REF( f2 );
  55. BOOST_TEST_REF( f3 );
  56. BOOST_TEST_REF( f4 );
  57. BOOST_TEST_REF( f5 );
  58. BOOST_TEST_REF( f6 );
  59. BOOST_TEST_REF( f7 );
  60. BOOST_TEST_REF( f8 );
  61. BOOST_TEST_REF( f9 );
  62. return boost::report_errors();
  63. }