]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/thread/test/functional/invoke/invoke_int_0_pass.cpp
1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Copyright (C) 2014 Vicente J. Botet Escriba
12 // Distributed under the Boost Software License, Version 1.0. (See accompanying
13 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
15 // <boost/thread/detail/invoke.hpp>
17 #include <boost/thread/detail/invoke.hpp>
18 #include <boost/detail/lightweight_test.hpp>
34 int operator()() const
46 #if defined BOOST_THREAD_PROVIDES_INVOKE
47 BOOST_TEST_EQ(boost::detail::invoke(f
), 1);
48 BOOST_TEST_EQ(boost::detail::invoke(&f
), 1);
49 BOOST_TEST_EQ(boost::detail::invoke(A_int_0()), 4);
50 BOOST_TEST_EQ(boost::detail::invoke(a
), 4);
51 BOOST_TEST_EQ(boost::detail::invoke(ca
), 5);
54 BOOST_TEST_EQ(boost::detail::invoke
<int>(f
), 1);
55 BOOST_TEST_EQ(boost::detail::invoke
<int>(&f
), 1);
56 BOOST_TEST_EQ(A_int_0()(), 4);
57 #if defined BOOST_THREAD_PROVIDES_INVOKE || ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
58 BOOST_TEST_EQ(boost::detail::invoke
<int>(A_int_0()), 4);
60 //BOOST_TEST_EQ(boost::detail::invoke<int>(A_int_0()), 5);
62 BOOST_TEST_EQ(a(), 4);
63 BOOST_TEST_EQ(boost::detail::invoke
<int>(a
), 4);
64 BOOST_TEST_EQ(ca(), 5);
65 BOOST_TEST_EQ(boost::detail::invoke
<int>(ca
), 5);
67 return boost::report_errors();