• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //  addressof_fn_test.cpp: addressof( f )
11 //
12 //  Copyright (c) 2008, 2009 Peter Dimov
13 //
14 //  Distributed under the Boost Software License, Version 1.0.
15 //  See accompanying file LICENSE_1_0.txt or copy at
16 //  http://www.boost.org/LICENSE_1_0.txt
17 
18 #include <boost/utility/addressof.hpp>
19 #include <boost/core/lightweight_test.hpp>
20 
21 
f0()22 void f0()
23 {
24 }
25 
f1(int)26 void f1(int)
27 {
28 }
29 
f2(int,int)30 void f2(int, int)
31 {
32 }
33 
f3(int,int,int)34 void f3(int, int, int)
35 {
36 }
37 
f4(int,int,int,int)38 void f4(int, int, int, int)
39 {
40 }
41 
f5(int,int,int,int,int)42 void f5(int, int, int, int, int)
43 {
44 }
45 
f6(int,int,int,int,int,int)46 void f6(int, int, int, int, int, int)
47 {
48 }
49 
f7(int,int,int,int,int,int,int)50 void f7(int, int, int, int, int, int, int)
51 {
52 }
53 
f8(int,int,int,int,int,int,int,int)54 void f8(int, int, int, int, int, int, int, int)
55 {
56 }
57 
f9(int,int,int,int,int,int,int,int,int)58 void f9(int, int, int, int, int, int, int, int, int)
59 {
60 }
61 
main()62 int main()
63 {
64     BOOST_TEST( boost::addressof( f0 ) == &f0 );
65     BOOST_TEST( boost::addressof( f1 ) == &f1 );
66     BOOST_TEST( boost::addressof( f2 ) == &f2 );
67     BOOST_TEST( boost::addressof( f3 ) == &f3 );
68     BOOST_TEST( boost::addressof( f4 ) == &f4 );
69     BOOST_TEST( boost::addressof( f5 ) == &f5 );
70     BOOST_TEST( boost::addressof( f6 ) == &f6 );
71     BOOST_TEST( boost::addressof( f7 ) == &f7 );
72     BOOST_TEST( boost::addressof( f8 ) == &f8 );
73     BOOST_TEST( boost::addressof( f9 ) == &f9 );
74 
75     return boost::report_errors();
76 }
77