]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/experimental/numeric
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / experimental / numeric
index 6d1dc21ff4dd93a625ce3c900bc302faa3ae7096..d8a904a7057f58f918d130ca5ec3d876efd13941 100644 (file)
@@ -1,6 +1,6 @@
 // <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
@@ -24,6 +24,7 @@
 
 /** @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
@@ -57,8 +56,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     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);
     }
 
@@ -67,14 +70,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     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