Skip to content

How to create a constructor that can fail? #195

@kevyuu

Description

@kevyuu

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.
 }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions