4 ms·
I would never have this typo as I usually delete the copy constructor in heavy structures.
by machina_ex_deus 1y ago
I would never have this typo as I usually delete the copy constructor in heavy structures.
- lionkor 1y agothis is the defensive and correct C++ approach, anyways.
- Ygg2 1y agoIsn't that just same old "skill issue", "No True C(++) programmer" refrain? If people could keep entirety of J.2 appendix in their mind at all time we would not have these issues. And if they had entirety of J appendix in mind all C code would be portable. Or if people just always ran -Wall -Wpedantic -Wall_for_real_this_time -fsanitize=thread,memory,address,leaks,prayers,hopes,dreams,eldritch_beings,elder_gods -fno-omit-frame-pointer I mean if this was all it took then C and C++ programs would be as safe as Rust. Which is not what we see in practice. And it's not like C programmers are an average web dev. It's a relatively niche and well versed community.
- lionkor 1y agoYes, it is the old "skill issue" argument. When your language is that unsafe and difficult to hold correctly, you have to make sure that you at least try your very best.
- colonwqbang 1y agoDo you ever use the C++ standard library? Most types have a copy ctor defined, also the really "heavy" ones.