dtolnay/cxx

Shared structs with type parameters

Open

#54 创建于 2020年3月2日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Rust (4,472 star) (253 fork)batch import
help wanted

描述

We should support structs that have type parameters and translate them to an ABI-compatible class template in C++.

#[cxx::bridge]
mod ffi {
    struct Generic<T> {
        wow: T,
    }

    extern "C" {
        fn f(g: Generic<String>);
    }
}

贡献者指南