This is the post in question. It accumulated four downvotes in an hour.
The post
The way I perceive the post, it conforms to the rules of the site
- Clearly on-topic
- Well-posed
- Shows effort through experimentation and correctly questions the results
Questioning the result is of particular importance, it is the primary deterrent against cargo cults.
As a high school student, the OP understandably has limited experience. With that in mind, requiring OP to know where and how to do all possible research is unreasonable.
The problem
However, the obvious problem here is the question is undeniably basic.
This is once again a debate on whether we support such questions.
On the one hand, from the point of view of experts, most questions about a language is basic. I suspect it being the reason why these experts don't ask many questions: they know they can get to an answer themselves, it's called "research". But there are only a handful of such experts, can we not ask a question for fear of it being "basic"?
On the other hand, votes are indicative of usefulness. We vote based on the usefulness of a post. Since the post is deemed too basic, it got downvoted.
Do we support such questions? At what point do we decide the question worthy of support? I find the line hard to draw.
std::option
already demonstrates that the asker has reasonable experience of the language to encounter this kind of problem, it's essentially different from someone not understanding howchar *
works.char*
works.std::string
is the one that should be understood,char*
is an implementation detail. I could argue anyone should know how to write a trailing return type for a lambda, it's introduced in C++11 so it's 7 years now. How can you say with such certainty it is objectively basic or not?char*
is at the root of both C and C++, why do you think the later is an implementation detail ? When I said too basic, I meant it's essentially asking us to write a tutorial/textbook, which is already stated in the answer below.