std::list::splice() 和 std::forward_list::splice_after() 在 C++11 中是否声明为 noexcept?

Are std::list::splice() and std::forward_list::splice_after() declared as noexcept in C++11?

Cppreference 没有提到 std::forward_list::splice_after() and std::list::splice() 的异常保证。

但是,由于这两个函数只更改列表节点的指针,因此不需要 copy/move 任何元素或分配任何内存,恕我直言,它们应该是 noexcept.

他们 noexceptC++11 吗?如果不是,为什么不呢?

除了一个之外,其他人都有“抛出: 没有。”在标准和缺失的标准中,它似乎是一个疏忽。

他们不是 noexcept 因为他们是狭义合同。如果您打破(许多)先决条件,调试模式实现可能想要抛出异常。