1 /* ///////////////////////////////////////////////////////////////////////
2 * File: address_of_test.h
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_UTILITY_ADDRESS_OF_TEST_H
13 #define EXTL_UTILITY_ADDRESS_OF_TEST_H
15 #ifndef EXTL_UTILITY_ADDRESS_OF_H
16 # error This file must be included of address_of.h
19 /* ///////////////////////////////////////////////////////////////////////
20 * ::extl::detail namespace
22 EXTL_TEST_BEGIN_NAMESPACE
24 /* ///////////////////////////////////////////////////////////////////////
27 struct address_of_test
32 int operator&(){return a
;}
41 EXTL_ASSERT(EXTL_ADDRESS_OF(sa
)->a
== 10);
42 EXTL_ASSERT(*EXTL_ADDRESS_OF(aa
) == 5);
43 EXTL_ASSERT(*EXTL_ADDRESS_OF(array
)[0] == 1);
48 address_of_test g_address_of_test
;
49 /* ///////////////////////////////////////////////////////////////////////
50 * ::extl::detail namespace
52 EXTL_TEST_END_NAMESPACE
54 /* //////////////////////////////////////////////////////////////////// */
55 #endif /* EXTL_UTILITY_ADDRESS_OF_TEST_H */
56 /* //////////////////////////////////////////////////////////////////// */