// <experimental/numeric> -*- C++ -*-
-// Copyright (C) 2015-2016 Free Software Foundation, Inc.
+// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
/** @file experimental/numeric
* This is a TS C++ Library header.
+ * @ingroup libfund-ts
*/
//
#pragma GCC system_header
-#if __cplusplus <= 201103L
-# include <bits/c++14_warning.h>
-#else
+#if __cplusplus >= 201402L
#include <numeric>
#include <experimental/type_traits>
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_gcd_lcm 201411
/// Greatest common divisor
constexpr common_type_t<_Mn, _Nn>
gcd(_Mn __m, _Nn __n)
{
- static_assert(is_integral<_Mn>::value, "arguments to gcd are integers");
- static_assert(is_integral<_Nn>::value, "arguments to gcd are integers");
+ static_assert(is_integral_v<_Mn>, "gcd arguments are integers");
+ static_assert(is_integral_v<_Nn>, "gcd arguments are integers");
+ static_assert(!is_same_v<remove_cv_t<_Mn>, bool>,
+ "gcd arguments are not bools");
+ static_assert(!is_same_v<remove_cv_t<_Nn>, bool>,
+ "gcd arguments are not bools");
return std::__detail::__gcd(__m, __n);
}
constexpr common_type_t<_Mn, _Nn>
lcm(_Mn __m, _Nn __n)
{
- static_assert(is_integral<_Mn>::value, "arguments to lcm are integers");
- static_assert(is_integral<_Nn>::value, "arguments to lcm are integers");
+ static_assert(is_integral_v<_Mn>, "lcm arguments are integers");
+ static_assert(is_integral_v<_Nn>, "lcm arguments are integers");
+ static_assert(!is_same_v<remove_cv_t<_Mn>, bool>,
+ "lcm arguments are not bools");
+ static_assert(!is_same_v<remove_cv_t<_Nn>, bool>,
+ "lcm arguments are not bools");
return std::__detail::__lcm(__m, __n);
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L