visual C++标准是否要求自己的迭代器是另一个可移动/可复制的

visual Does the C++ standard require its own iterators to be nothrow move/copy constructable?

本文关键字:另一个 可移动 可复制 迭代器 自己的 标准 C++ 是否 visual      更新时间:2023-10-16

在MSVC中,类型trait std::is_nothrow_move_constructible在发布版本中对于迭代器(至少对于map、set和vector)为true,但在调试版本中不为true。

标准库的迭代器类别都没有这种性质的特殊要求。所有迭代器都要求是CopyConstructable,但没有迭代器要求非抛出移动可构造。