diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-07-29 17:50:17 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-07-29 17:51:13 +0200 |
commit | 953d5a9d03b2a3ca439a79775a0c212965d91c20 (patch) | |
tree | 4e0dbc31abddc9603c8f62cb176e6ad5871fd468 /lib/events/eventcontent.cpp | |
parent | 36344a6e0283f924b72cb2b25001bdf212a7e707 (diff) | |
download | libquotient-953d5a9d03b2a3ca439a79775a0c212965d91c20.tar.gz libquotient-953d5a9d03b2a3ca439a79775a0c212965d91c20.zip |
Moving eventCast()
In a situation where you have an EventPtr that you want to place
somewhere as an `event_ptr_tt<SomeMoreSpecificEventType>` you have to
carefully check that the stored event is actually of
SomeMoreSpecificType and if it is, release() that event pointer,
downcast, and re-wrap it into that new event_ptr_tt - or, as can be seen
from the diff here, re-loadEvent() from JSON, which is simpler but
inefficient. To help clients, and the library, eventCast() can now
accept an rvalue smart pointer and do all the necessary things with it.
Diffstat (limited to 'lib/events/eventcontent.cpp')
0 files changed, 0 insertions, 0 deletions