gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage

Home Page:https://gnzlbg.github.io/static_vector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rework noexcept from Casey's feedback

gnzlbg opened this issue · comments

Add section on noexcept, classify all functions in two groups, functions with wide or narrow contracts (without/with preconditions). Functions with wide contracts (no preconditions) can be noexcept, those with narrow contracts should have either strong arguments for making them noexcept, or not be noexcept.

The last commit c046bcd reworded the exception safety discussion and added some arguments for noexcept, but these arguments are weak. In particular, all mutating operations have the precondition that the Capacity of the vector should not be exceeded, but they are still marked as conditionally noexcept (which is bad since it does not follow the standard library guidelines for noexcept).

Zach laine mentioned in the std-proposal thread:

At the last meeting, LEWG were taking the stance that (most) additions of noexcept and constexpr would be left up to implementers until the implications were better understood by the community as a whole.