Skip to content

Static member functions #1419

Open
@JCBurnside

Description

@JCBurnside

is there a way to declare a c++ opaque type with a static member? then have it translate to an associated function on the rust side? perhaps something like

#[cxx::bridge]
mod ffi {
    extern "C++" {
        type OpaqueType;
        impl OpaqueType {
            fn assoc_fun() -> RT;
        }
    }
}

with the c++ like

struct OpaqueType {
    // fields
    static RT assoc_fun();
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions