3 ms·
> Let's say that someone in a library somewhere has made what you consider to be a mistake. Or they consider something to be a conversion but the constructor is
by dataflow 2y ago
> Let's say that someone in a library somewhere has made what you consider to be a mistake. Or they consider something to be a conversion but the constructor is not trivial. For the push_back construction, can you then say what the call does without knowing the types?
I don't get the point of your question. You might as well ask: "Let's say someone in a library somewhere has defined their type's operator< to wipe your disk. If you see std::less<>()(a, b), can you say what the call does without knowing the types?"
To which the answer is... well, obviously, no. Same answer to your question.
What is this supposed to imply?
- lumb63 2y agoThis conversation makes me really happy I have successfully avoided C++ for the past two years.
- dataflow 2y agoThere was very little in this conversation that was C++ specific, so it's kind of baffling that this conversation led you to that conclusion. But in general: yes, that's a good thing. Don't use C++ if you don't need to. It has too many sharp edges and it shouldn't be used unless it's really necessary.
- Kamq 2y agoLet's narrow this down even more. Someone has made an implicit constructor that makes a network call because... people are dumb. This implicit constructor takes an integer. Does the following code make a network call? vec.push_back(4);
- dataflow 2y agoThat obviously depends on the type of vec, which you've given no information about.