
Martin Bonner wrote:
string* pstr = new super_string; delete pstr; is undefined behaviour. In practise, you get away with it if super_string doesnt do anything in its destructor,
From: Jeff Garland
No. The intent is that the above new/delete is supported. If it isn't then it's a really bad idea.
I think we differ on what is meant by "supported". I mean "is guaranteed by the standard". I think you mean "works on all known implementations and most likely future implementations". I'm happy to use code that is formally undefined but works in practise, but in this case I don't think the gain is worth it (but that is a personal judgement call). -- Martin Bonner Martin.Bonner@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB24 6WZ, ENGLAND Tel: +44 (0)1223 203894