Skip to content

How to aproach generics ? #80

@big-lip-bob

Description

@big-lip-bob

Since apparently i can't really use cached with generic functions (let's say fn add_one<T: One + Add<Output=T>>(n: T) -> T { n + T::one() }), how would i proceed to make a cache for a specific type that's valid as said generic (let's use usize) ?

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