Resource handles
The RAII half, written once for every handle type. Copy shares, move steals, and the last handle to a resource going away is what unloads it.
Resource
An empty handle: valid() is false until a loader's result is assigned to it. The Slot constructor is how the loaders in rmp::assets make a full one, from a reference the resource table has already counted.
valid, operator bool
True when this handle holds a resource. False for one that failed to load, was never assigned, or was moved from; if (texture) asks the same.
name
The name it was loaded under — "ui.ttf", "player.aseprite" — or "" for an empty handle. Valid while this handle holds it.
changed, reload
A texture loaded from a file in resources/ remembers it: changed() is true once the file differs from what the texture holds — the sprite redrawn and saved while the game runs — and reload() loads it again in place, so every handle to it draws the new picture:
if (rabbit.changed()) rabbit.reload();Debug builds on the desktop only, like rmp::Value::changed(); elsewhere, and for an empty handle, changed() is false and reload() does nothing. changed() compares two numbers: ask it every frame. reload() is false, and the texture as it was, when the file does not decode now.
raw
An empty resource yields a zeroed raylib struct rather than a crash. raylib draws nothing for one of those, which is the behaviour a missing asset should have: a hole in the picture, not a dead process.
operator const T &
Only an LVALUE converts. DrawTexture(rabbit, ...) compiles; Texture2D t = load_texture("x.png"); does NOT, and that is the point — it converted, the temporary handle died on the same line, and t was a texture that had already been unloaded. The README and four examples had it, and so did the UI's own font. The deleted && overload is what refuses the temporary: a const &-qualified function on its own would still accept one, because a const reference binds to an rvalue.