1 /* ///////////////////////////////////////////////////////////////////////
2 * File: operator_bool_test.h
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_UTILITY_OPERATOR_BOOL_TEST_H
13 #define EXTL_UTILITY_OPERATOR_BOOL_TEST_H
15 #ifndef EXTL_UTILITY_OPERATOR_BOOL_H
16 # error This file must be included of operator_bool.h
19 /* ///////////////////////////////////////////////////////////////////////
20 * ::extl::detail namespace
22 EXTL_TEST_BEGIN_NAMESPACE
24 /* ///////////////////////////////////////////////////////////////////////
27 struct operator_bool_test
31 EXTL_OPERATOR_BOOL_DEFINE_TYPE(test_ptr
, safe_bool_t
);
33 operator safe_bool_t() const
35 return EXTL_OPERATOR_BOOL_RETURN_RESULT(1);
38 e_bool_t
operator! () const
46 operator e_bool_t() const
60 #if !defined(EXTL_COMPILER_IS_MSVC) || _MSC_VER >1200
61 EXTL_ASSERT(!(p
== NULL
));
62 EXTL_ASSERT(p
!= NULL
);
65 /* Prohibit the promotion of the integer type*/
69 EXTL_ASSERT(np != p); */
73 #if !defined(EXTL_COMPILER_IS_BORLAND)
74 operator_bool_test g_operator_bool_test
;
76 /* ///////////////////////////////////////////////////////////////////////
77 * ::extl::detail namespace
79 EXTL_TEST_END_NAMESPACE
81 /* //////////////////////////////////////////////////////////////////// */
82 #endif /* EXTL_UTILITY_OPERATOR_BOOL_TEST_H */
83 /* //////////////////////////////////////////////////////////////////// */