Commit 352111c5 by Jonathan Wakely Committed by Jonathan Wakely

Add noexcept to std::integral_constant members

	* include/std/type_traits (integral_constant): Make member functions
	noexcept (LWG 2346).
	* include/std/utility (integer_sequence): Likewise.

From-SVN: r255312
parent 276515e6
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> 2017-11-30 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/65927 PR libstdc++/65927
......
...@@ -71,12 +71,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -71,12 +71,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static constexpr _Tp value = __v; static constexpr _Tp value = __v;
typedef _Tp value_type; typedef _Tp value_type;
typedef integral_constant<_Tp, __v> 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 #if __cplusplus > 201103L
#define __cpp_lib_integral_constant_callable 201304 #define __cpp_lib_integral_constant_callable 201304
constexpr value_type operator()() const { return value; } constexpr value_type operator()() const noexcept { return value; }
#endif #endif
}; };
......
...@@ -321,7 +321,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -321,7 +321,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct integer_sequence struct integer_sequence
{ {
typedef _Tp value_type; 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 /// Alias template make_integer_sequence
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment