mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-09-19 11:46:34 -04:00
30 lines
678 B
Plaintext
30 lines
678 B
Plaintext
|
|
||
|
// (C) Copyright Kohei Takahashi 2014
|
||
|
|
||
|
// Use, modification and distribution are subject to the
|
||
|
// Boost Software License, Version 1.0. (See accompanying file
|
||
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||
|
|
||
|
// See http://www.boost.org/libs/config for more information.
|
||
|
|
||
|
// MACRO: BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
|
||
|
// TITLE: C++14 return type deduction unavailable
|
||
|
// DESCRIPTION: The compiler does not support C++14 return type deduction
|
||
|
|
||
|
namespace boost_no_cxx14_return_type_deduction
|
||
|
{
|
||
|
|
||
|
template<typename T>
|
||
|
auto deduced_abs(T x)
|
||
|
{
|
||
|
return x > 0 ? x : -x;
|
||
|
}
|
||
|
|
||
|
int test()
|
||
|
{
|
||
|
return deduced_abs(2) - deduced_abs(-2);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|