[Bug c++/49045] [C++0x] unexpected "different exception specifier" error with noexcept
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Wed May 18 18:52:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49045
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-05-18 18:35:09 UTC ---
(In reply to comment #3)
I found a similar approach to Jason based on a helper trait:
template<typename _Tp>
void
swap(_Tp&, _Tp&);
template<typename _Tp>
struct __is_nothrow_swappable {
static const bool value = noexcept(swap(std::declval<_Tp&>(),
std::declval<_Tp&>()));
};
template<typename _Tp, __SIZE_TYPE__ _Nm>
void
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
noexcept(__is_nothrow_swappable<_Tp>::value);
template<typename _Tp, __SIZE_TYPE__ _Nm>
void
swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
noexcept(__is_nothrow_swappable<_Tp>::value)
{ }
More information about the Gcc-bugs
mailing list