Add noexcept to std::integral_constant members
authorJonathan Wakely <jwakely@redhat.com>
Fri, 1 Dec 2017 15:09:57 +0000 (15:09 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 1 Dec 2017 15:09:57 +0000 (15:09 +0000)
* include/std/type_traits (integral_constant): Make member functions
noexcept (LWG 2346).
* include/std/utility (integer_sequence): Likewise.

From-SVN: r255312

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/type_traits
libstdc++-v3/include/std/utility

index e25457812984e13c6b0d12f6395becc54bf0175c..a23830db4a5a5adb915e6563b57e24f06fd0cc62 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-01  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/std/type_traits (integral_constant): Make member functions
+       noexcept (LWG 2346).
+       * include/std/utility (integer_sequence): Likewise.
+
 2017-11-30  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/65927
index 723c137f5b925aafebbdb1728035f0f3ae2ce9fb..1d639e452f324452682637c9dc7485ea20987a26 100644 (file)
@@ -71,12 +71,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       static constexpr _Tp                  value = __v;
       typedef _Tp                           value_type;
       typedef integral_constant<_Tp, __v>   type;
-      constexpr operator value_type() const { return value; }
+      constexpr operator value_type() const noexcept { return value; }
 #if __cplusplus > 201103L
 
 #define __cpp_lib_integral_constant_callable 201304
 
-      constexpr value_type operator()() const { return value; }
+      constexpr value_type operator()() const noexcept { return value; }
 #endif
     };
 
index e7386320e2a15bce6bbaf635fe1c27e8116bf342..da17928feee727566aed39a45554f542a3952c9c 100644 (file)
@@ -321,7 +321,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct integer_sequence
     {
       typedef _Tp value_type;
-      static constexpr size_t size() { return sizeof...(_Idx); }
+      static constexpr size_t size() noexcept { return sizeof...(_Idx); }
     };
 
   /// Alias template make_integer_sequence