Yves, Mai's QSort shenanigans are starting to become troll bait.Quote:
Originally posted by Yves M P.S. Please don't get into flame-wars ;) This thread (and the last one on qsort) is interesting, so it's best not to get too personal. I would hate to have to close this thread :/
If I started a thread called "it is safe to use delete on operator new[]" would you keep allowing me to post code after code showing that "compiler x accepts it", knowing full well that doing this is undefined by ANSI standards? What would be my goal of continuosly posting it? What if I started another thread, "returning references to local variables is OK", and I showed that for "compiler x it is safe", how long would I get away with it? In general, how long can someone post saying "I've beaten the standard -- I got it to work for such-and-such a compiler" without people who know better turning it into a personal discussion? If you had a chance to take a look, you saw what happened at comp.lang.c++. It turned into polite explanation, to hostility after a few rounds with Mai (who never really ventured in there -- it took myself to post his findings to comp.lang.c++).
Copying non-POD objects without invoking the proper constructor is not defined by the ANSI standard, therefore not guaranteed to work (as is reported by Phillip Nicoletti when run on g++ and PG compilers). Is Mai claiming that it is guaranteed to work? If he is stating this, he should say "yes it is guaranteed to work" or "no, it is not guaranteed to work". At least we can somewhat pin down what his goal is here of posting this stuff. If he is saying that it is guaranteed to work, the experts will disagree, point to line and verse in the standard, and have a good laugh. If he is saying it is not guaranteed to work, at least state where it is not guaranteed to work (i.e. under what conditions, etc.).
As Paul Wendt mentions, every compiler known to man may work with QSort code, but maybe not. All the compilers Mai has may work if you call "delete" on a "new char[]". Does this make it correct code? Mai would think so, the experts know better.
Regards,
Paul McKenzie
