rmp::Ref
An optional reference: something that may not be there, and is not yours.
if (auto health = player.get<Health>()) health->hp -= 1;What Object::get<B>() and Handle::get() hand back. It is empty, or it refers to something; it owns nothing, and asking it is the if above — true when there is something, and then -> and * reach it. Keep it within the frame, like the reference spawn() returns; across frames, keep the Handle.
Not a T *: a pointer cannot say whether it may be null or whose it is, and this type says both. Not std::optional<std::reference_wrapper<T>> either, which says the same for the price of <functional> in every file with an object in it, and reads as health->get().hp.
REACHING INTO AN EMPTY ONE is a mistake in the game, and is said once, per type: * and -> then reach a stand-in, a default T made for the purpose and made again on every use, so the line that forgot the if writes to nothing instead of taking the player's game down with it. ([dev] strict stops a debug build there instead.) A type with no default constructor has no stand-in, and that one mistake ends the program — with the same message.
Ref
Refers to target, which stays whoever's it was.
operator bool
True when it refers to something.
operator*, operator->, operator==
What it refers to — or, empty, the stand-in above, and a line in the log.