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>);
    }
}

貢獻者指南