Summary
This episode addresses a subtle but potentially serious API design issue with nested types that both provide similar methods. Jason demonstrates how calling value.reset() on a smart pointer containing a type like std::any can lead to ambiguity - are you resetting the pointer itself or the contained object? This ambiguity can lead to undefined behavior when a developer intends one reset operation but inadvertently performs the other, with no compiler diagnostics to catch this design flaw.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[unique.ptr]70% match -
[smartptr]65% match -
[any]40% match