Summary
In this episode, Jason Turner explores an unconventional debugging technique: using the `explicit` keyword on copy constructors to identify unintended or accidental copies in C++ code. When a class's copy constructor is marked as `explicit`, all implicit copies of that class will fail to compile, forcing developers to explicitly show their intent when making copies. This technique can help identify unexpected copies of expensive objects that might hurt performance, though Jason notes it's more of a diagnostic tool than something you'd want in production code.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[diff.cpp17.class]50% match