]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/config/test/boost_no_cxx14_return_type_ded.ipp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / config / test / boost_no_cxx14_return_type_ded.ipp
1
2 // (C) Copyright Kohei Takahashi 2014
3
4 // Use, modification and distribution are subject to the
5 // Boost Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
8 // See http://www.boost.org/libs/config for more information.
9
10 // MACRO: BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
11 // TITLE: C++14 return type deduction unavailable
12 // DESCRIPTION: The compiler does not support C++14 return type deduction
13
14 namespace boost_no_cxx14_return_type_deduction
15 {
16
17 template<typename T>
18 auto deduced_abs(T x)
19 {
20 return x > 0 ? x : -x;
21 }
22
23 int test()
24 {
25 return deduced_abs(2) - deduced_abs(-2);
26 }
27
28 }
29