observe me not - a short story about smart pointers
summary
Shows that taking a smart pointer by const reference causes an extra dependent load and that the cheap fix is to accept a raw pointer at the callee. Implements a ref-qualified conversion operator on the smart-pointer type so only lvalues implicitly convert to T*, preventing accidental capture of temporaries. Cites historical MSVC behavior and Mozilla RefPtr, notes the approach reduces overhead and keeps call sites clean but warns about captures, coroutines and ternary-operator temporaries that still require .get().
AI-written summary · about
related talks
53mSmart Pointers in C++
01h 33mSafe and Sane C++ Types
31mSmart References: There and Back Again
01h 20mRevisiting C++ Observers: Spooky Action at a Distance
19mC++ Const Correctness Refresher
04mSmart Pointers in C++ Are Not Pointers
01h 02mFancy Pointers for Fun and Profit
01h 00mBack to Basics: Pointers
