]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/test/compile_fail/attr_functor_void_return.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / log / test / compile_fail / attr_functor_void_return.cpp
1 /*
2 * Copyright Andrey Semashev 2007 - 2015.
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 attr_functor_void_return.cpp
9 * \author Andrey Semashev
10 * \date 25.01.2009
11 *
12 * \brief This test checks that it is not possible to create a functor attribute
13 * with a void-returning functor.
14 */
15
16 #define BOOST_TEST_MODULE attr_functor_void_return
17
18 #include <boost/utility/result_of.hpp>
19 #include <boost/log/attributes/attribute.hpp>
20 #include <boost/log/attributes/function.hpp>
21
22 namespace logging = boost::log;
23 namespace attrs = logging::attributes;
24
25 namespace {
26
27 // A test function that returns an attribute value
28 void get_attr_value();
29
30 } // namespace
31
32 int main(int, char*[])
33 {
34 logging::attribute attr1 =
35 #ifndef BOOST_NO_RESULT_OF
36 attrs::make_function(&get_attr_value);
37 #else
38 attrs::make_function< void >(&get_attr_value);
39 #endif
40
41 return 0;
42 }