In my previous article (“abstraction design and implementation: repeat
”) I’ve shown how to implement a simple repeat(n, f)
abstraction that invokes a FunctionObject
f
\(n\) times in a row.
A large part of the article focused on adding a noexcept
specifier to repeat
that correctly propagated noexcept
-correctness depending on the actions performed on the passed arguments. Adding a noexcept
specifier resulted in a less elegant, longer, and less accessible implementation.
Is it worth the hassle? Jason Rice posted a comment on the previous article asking: