Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclusively increasing? #253

Open
cheako opened this issue Nov 20, 2022 · 3 comments
Open

Exclusively increasing? #253

cheako opened this issue Nov 20, 2022 · 3 comments

Comments

@cheako
Copy link

cheako commented Nov 20, 2022

Hello,
I was looking for a type that could only ever increase. Useful for the CPU side of Vulkan's Timeline Semaphores. I know I could trivially implement this, I was just wondering if this is something one of the num crates would be interested in including?

@cuviper
Copy link
Member

cuviper commented Nov 21, 2022

It doesn't sound like a trait, at least, until there are multiple types with this characteristic and a need to be generic over those types. Then if a 3rd party crate is defining such types, it probably makes sense to define its own trait too.

My sense is that your idea would be quite domain specific, especially when getting into details like thread-safety and overflow behavior, so it doesn't seem like something that I would put in a generic num crate.

@cheako
Copy link
Author

cheako commented Nov 21, 2022

By the sound of this, we are on the same page WRGT the type and traits and how they would function. I did understand that num-traits wasn't the exact crate these would belong. Is there a number utility crate where this might live, where might I seek this addition? Creation of a new crate?

I'm guessing there are less than a handful of implementations for this and even though my domain would only use one, implementing all of them wouldn't seem a waste at all.

@cuviper
Copy link
Member

cuviper commented Nov 21, 2022

I don't think there's a natural place for this, at least not in the crates in this org. Maybe you'd like to publish your own crate for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants