How would You translate the idea of traits from Rust to C
To clarify, I mean You as the implementor.
I was thinking
trait Iterator
{
type Item;
fn next(&mut self) -> Option<Self::Item>;
}
Would be a good example to translate to C,\
first, because I’m not good enough at C to actually do this and,\
second, because I was having trouble translating the ideas of composition using traits in Rust into C, which confused the hell out of my coworkers, and made my code look like poo.
I know this might be a bit off topic, but I know you guys probably understand Rust to C better than the C subreddits do by a mile and I feel like I won’t get the annoying “why do you want to do that?” question here.
Apologies in advance for not being able to post any true example code, company proprietary policies are as draconian as their decisions about what language to use.