LuaBridge3 icon indicating copy to clipboard operation
LuaBridge3 copied to clipboard

How to create a constructor that can fail?

Open kevyuu opened this issue 11 months ago • 4 comments

Basically, I want to have a way to add constructor that can fail and return an error code just like Stack api.

struct LuaTexture {
 gpu::TextureID texture_id;
 
 static auto FromPath(const Path& texture_path) -> TypeResult<LuaTexture> {
  // check whether path is valid.
 }
};

kevyuu avatar Feb 23 '25 16:02 kevyuu