> Reproducible functions should only be able to call other reproducible and unsequenced functions.
> Unsequenced functions should only be able to call other unsequenced functions.
Please no. Contrary to intuition, "reproducible" is not a property
that can simply be combined bottom-up.
For example, std::exchange is not reproducible, but a reproducible
function could make use of it. Since [[unsequenced]] is even stricter,
the same applies. Similarly, std::swap for an array of ints is
reproducible, but std::swap isn't.
On that note, C++ also faces the unique problem that only some
specializations of function templates are [[reproducible]] or
[[unsequenced]]. SInce C doesn't have generics, it doesn't have this
problem. For example, std::sort for any standard library container is
reproducible, but not for user-defined types that could do
god-knows-what when swapped.
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals