dtolnay/cxx

Shared structs with type parameters

Open

#54 opened on Mar 2, 2020

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Rust (4,472 stars) (253 forks)batch import
help wanted

Description

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

Contributor guide