]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/core/test/explicit_operator_bool_compile_fail_delete.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / core / test / explicit_operator_bool_compile_fail_delete.cpp
1 /*
2 * Copyright Andrey Semashev 2007 - 2013.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
6 */
7 /*!
8 * \file explicit_operator_bool_compile_fail_delete.cpp
9 * \author Andrey Semashev
10 * \date 17.07.2010
11 *
12 * \brief This test checks that explicit operator bool cannot be used in
13 * an unintended context.
14 */
15
16 #define BOOST_TEST_MODULE util_explicit_operator_bool_delete
17
18 #include <boost/utility/explicit_operator_bool.hpp>
19
20 namespace {
21
22 // A test object that has the operator of explicit conversion to bool
23 struct checkable
24 {
25 BOOST_EXPLICIT_OPERATOR_BOOL()
26 bool operator! () const
27 {
28 return false;
29 }
30 };
31
32 } // namespace
33
34 int main(int, char*[])
35 {
36 checkable val;
37 delete val;
38
39 return 0;
40 }