addressof_fn_test.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. // addressof_fn_test.cpp: addressof( f )
  9. //
  10. // Copyright (c) 2008, 2009 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/utility/addressof.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. int main()
  48. {
  49. BOOST_TEST( boost::addressof( f0 ) == &f0 );
  50. BOOST_TEST( boost::addressof( f1 ) == &f1 );
  51. BOOST_TEST( boost::addressof( f2 ) == &f2 );
  52. BOOST_TEST( boost::addressof( f3 ) == &f3 );
  53. BOOST_TEST( boost::addressof( f4 ) == &f4 );
  54. BOOST_TEST( boost::addressof( f5 ) == &f5 );
  55. BOOST_TEST( boost::addressof( f6 ) == &f6 );
  56. BOOST_TEST( boost::addressof( f7 ) == &f7 );
  57. BOOST_TEST( boost::addressof( f8 ) == &f8 );
  58. BOOST_TEST( boost::addressof( f9 ) == &f9 );
  59. return boost::report_errors();
  60. }