-
Notifications
You must be signed in to change notification settings - Fork 49
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
Generic intrusive adaptors #1
Comments
I don't think this is possible with the current For now you'll just have to manually implement the |
It is possible in a limited way: you can't have bounds on the type parameters. This is still useful in the short term I think. (I'm working on a patch right now) |
Well, I thought it was possible, seems not. Oh well. |
Fixed in 0.5.0. |
I am trying to make this work for a struct with two type parameters, like this: pub struct ObjectSet<T, U> {
set_list: linked_list::Link,
pub objects: Vec<Object<T>>,
pub metadata: U,
}
intrusive_adapter!(ObjectSetAdapter<T, U> = Box<ObjectSet<T, U>>: ObjectSet<T, U> { set_list: linked_list::Link }); However I'm getting this compiler error:
The compiler didn't complain about a similar intrusive_adapter! with one type argument. Can you tell if I'm doing something wrong or if this might be a bug? |
Fixed in 0.6.2. |
Thanks :) |
It would be nice to have the macro able to generate generic adaptors. For example, to make using the following nice:
(Macro syntax come up with on-the-spot, not sure if that would parse)
The text was updated successfully, but these errors were encountered: