]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/core/test/eif_dummy_arg_disambiguation.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / core / test / eif_dummy_arg_disambiguation.cpp
CommitLineData
7c673cae
FG
1// Boost enable_if library
2
3// Copyright 2003 (c) The Trustees of Indiana University.
4
5// Use, modification, and distribution is subject to the Boost Software
6// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8
9// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
10// Jeremiah Willcock (jewillco at osl.iu.edu)
11// Andrew Lumsdaine (lums at osl.iu.edu)
12
13#include <boost/utility/enable_if.hpp>
14#include <boost/type_traits/is_arithmetic.hpp>
f67539c2 15#include <boost/core/lightweight_test.hpp>
7c673cae
FG
16
17using boost::enable_if;
18using boost::disable_if;
19using boost::is_arithmetic;
20
21template <int N> struct dummy {
22 dummy(int) {};
23};
24
25template<class T>
26typename enable_if<is_arithmetic<T>, bool>::type
1e59de90 27arithmetic_object(T /*t*/, dummy<0> = 0) { return true; }
7c673cae
FG
28
29template<class T>
30typename disable_if<is_arithmetic<T>, bool>::type
1e59de90 31arithmetic_object(T /*t*/, dummy<1> = 0) { return false; }
7c673cae
FG
32
33
34int main()
35{
36
37 BOOST_TEST(arithmetic_object(1));
38 BOOST_TEST(arithmetic_object(1.0));
39
40 BOOST_TEST(!arithmetic_object("1"));
41 BOOST_TEST(!arithmetic_object(static_cast<void*>(0)));
42
43 return boost::report_errors();
44}