MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1q1syp2/every_llm_hallucinates_that_stdvector_deletes/nxe2f73/?context=3
r/cpp • u/am17an • Jan 02 '26
https://am17an.bearblog.dev/every-llm-hallucinates-stdvector-deletes-elements-in-a-lifo-order
118 comments sorted by
View all comments
Show parent comment
2
Why on earth would the standard be expected to define the exact order that elements in a vector are destroyed?
5 u/The_JSQuareD Jan 03 '26 edited Jan 03 '26 To... standardize behaviors.Or to give you a less glib answer: the standard defines the order destructors run in when you call delete[]. It is reasonable to expect that it would also define it for the most common library wrapper around a dynamic array.
5
To... standardize behaviors.
Or to give you a less glib answer: the standard defines the order destructors run in when you call delete[]. It is reasonable to expect that it would also define it for the most common library wrapper around a dynamic array.
delete[]
View all comments
Show parent comment
2
u/NotMyRealNameObv Jan 03 '26
Why on earth would the standard be expected to define the exact order that elements in a vector are destroyed?