3 ms·
I found that when I wrote C++, I almost exclusively ended up using features that were already in C; obviously there are no classes in C, but I was happy enough
by tombert 8y ago
I found that when I wrote C++, I almost exclusively ended up using features that were already in C; obviously there are no classes in C, but I was happy enough using structs and functions that just take a pointer of that struct type for the first argument.
- Longhanks 8y agoWhich is why the functions in <algorithm> and many more STL headers are just that; templated functions. There's nothing wrong with them. However, modern C++ enables safer and clearer semantics than what raw pointers offer, such as references or smart pointers.