use std::fmt::Display; use cpp_oop::gen_oop; gen_oop! { struct Test { x: T } struct TestLayout { #[generics(A: Display)] a: fn(this: &Self, a: A, b: T) -> String, } impl TestMethodsInner for Test { extern "C" fn a_inner(_this: &Self, a: A, b: T) -> String { format!("{}{}", a, b) } } } #[test] fn test() { let t = Test { x: 0 }; assert_eq!(t.a("e", 0), "e0"); }