We seem to be seeing some issues with mixing a bare pointer with a shared pointer and I wondered if there's a way to generate a compile time error in that case ?
The scenario is that we're using an LRU cache - which returns a SharedPtr from a item lookup. But some developers (not me

stored the results of a cache lookup in a bare pointer. When the cache item was replaced the code paths that used bare pointers had issues, those (mine

that used SharedPtr's were okay.
Since this has happened multiple times I'd like to solve it mechanically...
Any thoughts ?
richard.