Why is swapping multidimensional arrays not noexcept?

对着背影说爱祢 提交于 2019-12-03 00:00:19

This overload:

template<class T, size_t N>
void swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b)));

is not in scope until ;, so swap(*a, *b) doesn't consider this overload. This is because of:

3.3.2/1 The point of declaration for a name is immediately after its complete declarator (Clause 8) and before its initializer (if any) …

and the exception specification is part of the declarator.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!