forked from boostorg/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddressof_np_test.cpp
More file actions
50 lines (40 loc) · 851 Bytes
/
addressof_np_test.cpp
File metadata and controls
50 lines (40 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Copyright 2013 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/utility/addressof.hpp>
#include <boost/core/lightweight_test.hpp>
#include <cstddef>
#if defined( BOOST_NO_CXX11_NULLPTR )
void nullptr_test()
{
}
#else
void nullptr_test()
{
{
auto x = nullptr;
BOOST_TEST( boost::addressof(x) == &x );
}
{
auto const x = nullptr;
BOOST_TEST( boost::addressof(x) == &x );
}
{
auto volatile x = nullptr;
BOOST_TEST( boost::addressof(x) == &x );
}
{
auto const volatile x = nullptr;
BOOST_TEST( boost::addressof(x) == &x );
}
}
#endif
int main()
{
nullptr_test();
return boost::report_errors();
}