Issue finding the position inside a collection of borrowed trait object

Thanks! Your solution worked :slight_smile:

The vtable was different, but the (raw/thin) ptr was the same. By only comparing the first usize (as converting straight to usize did not work), the code produces correct results. This is not an ideal solution but I will stick with it for now. Thanks again.

PS: Note I found another person have a similar problem: "[Solved] Arc, traits, inheritance, and how to compare two pointers" It is funny that both of us had the same problem when developing a light transport engine :smiley:

1 Like