Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::marker::PhantomData;
- struct ID<Entity>(u32, PhantomData<Entity>);
- impl<Entity1> ID<Entity1> {
- fn cast<Entity2>(&self) -> ID<Entity2> {
- ID::<Entity2>(self.0, PhantomData)
- }
- }
- fn main() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement