r/cpp • • Oct 24 '24 • Take My Silver 1

Why Safety Profiles Failed

https://www.circle-lang.org/draft-profiles.html
180 Upvotes

347 comments sorted by

View all comments

Show parent comment

8

u/andwass Oct 25 '24

Yes

vec.push_back(vec[0]);

is guaranteed to work.

2

u/throw_cpp_account Oct 25 '24

It is, but it would be better if the way it were guaranteed to work is by the language enforcing uniqueness of the input rather the library having to be very careful around these not-very-well-specified edge cases (i.e. we don't say it doesn't work anywhere therefore it does).