open_toontown_panda3d/dtool/src
rdb ad3ab3ad21 Define stable ordering for WeakPointerTo for use as map/set key
Currently, the WeakPointerTo comparison operators compare the raw pointers, but this is not useful as it may cause a false equality if one weak pointer in the comparison is expired and points to memory that has since been reused.

Instead, we can define a comparison based on the control block pointer, which exists since the new weak pointer implementation in 0bb81a43c9.  This is implemented in the owner_before method, matching C++11 std::weak_ptr semantics.

I would now recommend deprecating most comparison operators of WeakPointerTo or redefining them to make more sense, ie. comparing equal if they (once) referred to the same object and not if they simply point to the same memory address.  This has not yet been done, though code that uses the comparison operators has been fixed in this commit.

Overloads of std::owner_less have been provided for creating a map or set with Weak(Const)PointerTo keys.
2018-07-30 17:27:09 +02:00
..
cppparser cppparser: class is not implicitly copyable if it has a move ctor 2018-06-30 21:38:45 +02:00
dconfig general: Remove `using std::*` from headers 2018-06-14 16:04:49 +02:00
dtoolbase Define stable ordering for WeakPointerTo for use as map/set key 2018-07-30 17:27:09 +02:00
dtoolutil dtoolutil: fix PandaSystem TypeHandle static init issue 2018-07-04 20:29:31 +02:00
interrogate interrogate: support enum class to limited extent in Python 2 2018-07-02 12:16:35 +02:00
interrogatedb interrogate: support enum class to limited extent in Python 2 2018-07-02 12:16:35 +02:00
parser-inc parser-inc: add timespec 2018-07-17 22:21:44 +02:00
prc general: Remove `using std::*` from headers 2018-06-14 16:04:49 +02:00
prckeys general: Remove `using std::*` from headers 2018-06-14 16:04:49 +02:00
pystub interrogate: support enum class to limited extent in Python 2 2018-07-02 12:16:35 +02:00
test_interrogate general: Remove `using std::*` from headers 2018-06-14 16:04:49 +02:00