Relative Content

Tag Archive for c++containersc++20clang++noexcept

Why is clang not consistent on noexcept(++it) and noexcept(*it) for containers?

I’m not sure if it is specified in the standard that advance/dereference of standard container iterator are noexcept. GCC and MSVC consistently make them noexcept for all standard containers. But clang make them noexcept for std::vector/std::basic_string and noexcept(false) for std::list/std::set/std::map/std::unordered_set/std::unordered_map.

Why is clang not consistent on noexcept(++it) and noexcept(*it) for containers?

I’m not sure if it is specified in the standard that advance/dereference of standard container iterator are noexcept. GCC and MSVC consistently make them noexcept for all standard containers. But clang make them noexcept for std::vector/std::basic_string and noexcept(false) for std::list/std::set/std::map/std::unordered_set/std::unordered_map.

Why is clang not consistent on noexcept(++it) and noexcept(*it) for containers?

I’m not sure if it is specified in the standard that advance/dereference of standard container iterator are noexcept. GCC and MSVC consistently make them noexcept for all standard containers. But clang make them noexcept for std::vector/std::basic_string and noexcept(false) for std::list/std::set/std::map/std::unordered_set/std::unordered_map.