
21 Aug
2011
21 Aug
'11
10:53 p.m.
Nevin Liber wrote:
On 21 August 2011 05:10, Vicente J. Botet Escriba <vicente.botet@wanadoo.fr>wrote:
I understand that Boost can not rely on libraries promoting undefined behavior, but sometimes using undefined behavior can be accepted if at the end the function ensures everything is in a state that is consistent.
If you invoke undefined behavior, by definition it is impossible to ensure everything is in a consistent state afterwards. Undefined behavior really means "don't go there".
In this case however the undefined behaviour is not inherent to the technique. A warned person can avoid the undefined behaviour, just like a warned person can avoid deleting the same pointer twice.