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
This commit is contained in:
Jonathan Wakely 2017-12-01 15:09:57 +00:00 committed by Jonathan Wakely
parent 276515e6ad
commit 352111c5b1
3 changed files with 9 additions and 3 deletions

View 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

View 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
};

View 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