Skip to content

Commit

Permalink
Add noexcept to std::integral_constant members
Browse files Browse the repository at this point in the history
	* include/std/type_traits (integral_constant): Make member functions
	noexcept (LWG 2346).
	* include/std/utility (integer_sequence): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255312 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
redi committed Dec 1, 2017
1 parent f0efd2e commit 962c279
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions libstdc++-v3/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2017-12-01 Jonathan Wakely <[email protected]>

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

2017-11-30 Jonathan Wakely <[email protected]>

PR libstdc++/65927
Expand Down
4 changes: 2 additions & 2 deletions libstdc++-v3/include/std/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
2 changes: 1 addition & 1 deletion libstdc++-v3/include/std/utility
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 962c279

Please sign in to comment.