дизайн-языка

Why std::find returns a pointer?

Why the find() method uses a pointer. That is, in this example #include <iostream> // std::cout #include <algori ... ay. We just need to search for it in the array and that's it. Why can't this be done without a pointer? Thank you in advance!

Why do I need iter when there is next?

I'm learning python and I have a question about iterators. In order to iterate over an object, it must have a __iter__ method ... rn random() else: raise StopIteration So I have a question, what is the meaning of the __iter__ method?

Why is the comma in indexing deprecated in C++20?

Why is the use of the , operator in the [] array indexing operator deprecated in C++20? For example, the following use-case n ... g(index), index] << '\n'; } Warning: top-level comma expression in array subscript is deprecated [-Wcomma-subscript]

Why do I need the Unreachable statement error?

Why does the compiler throw this error? What's wrong with the code not executing??

Writing a programming language: where to start? [closed]

Closed. This question is off-topic. Answers to it are not accepted at the moment. ... ite some simple programming language for the web. No delusions of grandeur, just want to try. Can you tell me where to start?

Why do I need a static class?

Static variables are needed to access them, without creating an instance of the class. But why do we need a static class?

Local runtime constant

In C++, to define a local runtime constant, you can write this: const auto c = f(); Next, all attempts to change c will re ... ailable to ensure local time constancy C#execution? Is it really necessary to create a separate read-only interface for this?

Why is the priority of the postfix increment greater than the prefix increment?

It turned out that the postfix increment and decrement have a higher priority than the prefix (source). However, there is als ... osen this way? I do not see any harm to compatibility with C, if the priorities are set like this: PS: Based on question.