Я не уверен, указано ли в стандарте, что продвижение/разыменование стандартного итератора контейнера не является исключением. GCC и MSVC последовательно исключают их для всех стандартных контейнеров. Но clang делает их noException для std::vector/std::basic_string и noException(false) для std::list/std::set/std::map/std::unordered_set/std::unordered_map.
Пример кода можно найти ниже или на сайте godbolt.
#include
#include
#include
#include
#include
#include
#include
#include
template
concept nothrow_advancable = noexcept(++std::declval());
template
concept nothrow_dereferencable = noexcept(*std::declval());
static_assert(nothrow_advancable);
static_assert(nothrow_advancable);
static_assert(nothrow_advancable); // not noexcept with clang
static_assert(nothrow_advancable); // not noexcept with clang
static_assert(nothrow_advancable); // not noexcept with clang
static_assert(nothrow_advancable); // not noexcept with clang
static_assert(nothrow_advancable); // not noexcept with clang
static_assert(nothrow_dereferencable);
static_assert(nothrow_dereferencable);
static_assert(nothrow_dereferencable); // not noexcept with clang
static_assert(nothrow_dereferencable); // not noexcept with clang
static_assert(nothrow_dereferencable); // not noexcept with clang
static_assert(nothrow_dereferencable); // not noexcept with clang
static_assert(nothrow_dereferencable); // not noexcept with clang
Подробнее здесь: https://stackoverflow.com/questions/793 ... containers