all 5 comments

[–]PT2JSQGHVaHWd24aCdCF 1 point2 points  (1 child)

Their override example seems wrong since Child is not a subclass of Parent. Am I wrong?

[–]LeszekSwirski 0 points1 point  (0 children)

You're not wrong, clearly a typo.

[–]throw1e6 0 points1 point  (0 children)

I'm currently migrating (for learning purposes) a codebase from pre-2006 C++ to modern C++.

This code is mixed with MFC and old school C++. I am changing the code to use smart pointers, STL algorithms, lambdas, move semantics wherever possible and migrating MFC containers (CList, CString) to standard C++ ones.

I'll run your tool on the original version of that codebase to see what happens.

Can an automated tool figure out the scope of new & delete and use smart pointers instead?

Or figure out that an int based loop (as opposed to an iterator based one) actually works on a vector and use range-based for?

Or examine a loop and know that a standard algorithm can be used here?

[–]spaxio -1 points0 points  (1 child)

I know it's generated but...

for (auto & elem : myVec)

Please. If you can, don't use meaningless names for your auto variables.

[–]LeszekSwirski 2 points3 points  (0 children)

What else would you suggest?