r/cpp
•
u/steveklabnik1
•
Oct 24 '24
•
1
Why Safety Profiles Failed
https://www.circle-lang.org/draft-profiles.html
180
Upvotes
View all comments
Show parent comment
-1
u/germandiago Oct 26 '24
This is a non-problem, use
std::sort(rng). Orstd::sort(rng | ...)if you want pieces of that range: that makes impossible to give the wrong iterators to the function.That is the very problem with Sean's paper: he presents many of the non-problems as problems as if they had no solution at all, or omits things proposed in other papers as solutions, like invalidation, when in fact there are strategies to deal with that also.
One solution (I do not mean it should be this, the solution, but it is definitely a solution):
sort(beg, end)is unsafe -> usesort(rng). And get done with it.