1

Nota: the post I am talking about is this one.

While discussing on another question (here for reference), I got a link to that answer which had just been deleted. Here is its original content (I have edited it to remove the first sentence):

I can't comment, so I'll post my comment as an answer. The currently accepted answer is wrong. Compiler can't optimize to return 42.

Even though reinterpret_cast from "pointer to an array element type" T* to "pointer to the array type" T(*)[N] will not give you a pointer to the array object, you can std::launder the result of reinterpret_cast and get the pointer to the array object (if it exists, of course). All the bytes of the immediately-enclosing array object of an array element are reachable through the pointer to the array element. (see http://eel.is/c++draft/ptr.launder).

Given p0 = &a.x[1], p1 = p0 - 1 points to a.x[0], p2 = std::launder(reinterpret_cast<double(*)[4]>(p1)) points to a.x, p3 = reinterpret_cast<A*>(p2) points to a, p3->n = 88 changes a.n and return 42 would be incorrect optimization.

Ok, it was written by a 1rep only user, is a late answer and starts with I can't comment so post as an answer.

The point is that it is indeed written as an acceptable answer:

  • it is relevant for the question
  • it contains interesting material
  • it is far to long and detailed to be a simple comment

If it had not been deleted by a moderator, I would have edited it to remove the sentence (wrongly) stating it was a comment, and would have voted for undelete. Not that I really agree with that interpretation of the standard, but my opinion is still that it tries to answer the question.

Simply a post deleted by a diamond moderator cannot by undeleted by the community, hence this question.


Edit:

Even after removing the I can't comment... part, the post was still written as a comment. After BoltClock's advice I have edited it a bit further to first make it an answer, and then explain why the accepted answer should be wrong.

14
  • 10
    it is far to long and detailed to be a simple comment doesn't make a post intended as a comment automatically exempt from moderator intervention. It is not an answer to the question, it is an attempt at commenting on another answer.
    – Martijn Pieters Mod
    Jul 27, 2018 at 13:58
  • 5
    An answer can, of course, endeavor to answer the question while also containing commentary on another answer (e.g. if the author is worried about their comments getting deleted for no rhyme or reason because c o m m e n t s a r e e p h e m e r a l). But that's where this specific answer is lacking.
    – BoltClock
    Jul 27, 2018 at 14:06
  • 2
    "If it had not been deleted by a moderator, I would have edited it to remove the sentence (wrongly) stating it was a comment, and would have voted for undelete. " - you'd just be removing the easy knee-jerk lure. But then the next sentence would still be "The currently accepted answer is wrong. ". That's still just as much a clear-cut commenting on another answer, only without the honest confession to go along with it.
    – Gimby
    Jul 27, 2018 at 14:27
  • @BoltClock: The point is that the answer says that std::launder can convert between a pointer to an array and a pointer to its first element which is an answer to the question. I understand that in its current wording the reader must find its way amont details only relative to another answer. Would it be acceptable that I edit the answer further to make it more explicit? Jul 27, 2018 at 15:43
  • @Serge Ballesta: That's a good idea.
    – BoltClock
    Jul 27, 2018 at 15:44
  • @BoltClock: What do you thing of my current edit? Jul 27, 2018 at 15:55
  • @SergeBallesta You have your own answer with which to present your own solution to the problem. Don't go around editing the answer you think is best into other people's posts. Normally I'd roll it back, but with it being deleted I'm not going to bother. Had the post author decided on an answer and edited it into their post, they could perhaps turn it into an actual answer.
    – Servy
    Jul 27, 2018 at 15:57
  • @Servy: My answer actually argues the opposite opinion. Simply that comment/answer contains the std::launder part which constitute a serious argument (it was upvoted before being deleted). I do not want to endorse that opinion, but I would find fair to allow the poster of that solution to present it. If comments were not disabled on deleted post, I would have pinged the author in a comment before that edit. Maybe I should ping him from a non deleted post like this one? Jul 27, 2018 at 16:05
  • I could post an new answer with the relevant parts of this deleted one, but it would really be plagiarism and I do not want to steal reputation from the original author. Jul 27, 2018 at 16:08
  • 1
    @SergeBallesta Whether it's an answer you endorse doesn't really matter. The point is you're editing an answer into someone else's post that doesn't have one, rather than letting them write their own answer.
    – Servy
    Jul 27, 2018 at 16:08
  • 1
    @SergeBallesta Given that that post is attempting to be a comment on another answer, rather than an attempt to answer the question, you could just post a comment with that information if you really feel that it's that valuable. You naturally need to cite the author, since it's not your own original work.
    – Servy
    Jul 27, 2018 at 16:09
  • Not so sure how this went wrong. It went through two review queues but only a single reviewer in each voted (seems common lately), they both liked it well enough. The mod might still see it, not sure. Not an easy answer to judge, the only truly readable sentence for mere mortals was the "I can't comment" phrase, that couldn't have helped. I recommend you custom flag it with something like "this was an appropriate answer, please consider to undelete it". Jul 27, 2018 at 16:10
  • @Servy: Thank you for your explainations. I have accepted your answer. Jul 27, 2018 at 16:12
  • @HansPassant: Thank you for your comment. I realize that even if it contains elements for an interesting answer, the edit to make it be first an answer and only after a comment changes it too much to be made by anybody else than the original author. I'll try to ping him from another post. If he edits his answer, then the custom flag would be more appropriate. Jul 27, 2018 at 16:16

1 Answer 1

12

Information being relevant to the question does not make it an answer to the question. Whether you think it's interesting also doesn't make it an answer. The post being too long for it to be a comment also doesn't make it an answer.

An explanation of why another answer is wrong is a comment (on that answer). It doesn't become an answer just because it's too long or because you think it's interesting. It becomes an answer when it attempts to answer the question, rather than explain why another answer is wrong.

Many other things people say that are "relevant to the question" aren't answers too, like suggestions for how the question can be improved, requests for clarification, others stating they have a similar problem, i.e. all of the other textbook examples of non-answers that should be deleted if posted as an answer.

Oh, and that isn't even too much content to need an answer. One could just post each paragraph as a comment just fine (if one had the 50 rep to comment at all).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .