Snapchat / djinni

A tool for generating cross-language type declarations and interface bindings. Djinni's new home is in the Snapchat org.
Apache License 2.0
166 stars 44 forks source link

[suggestion] Add reference symbol for embind methods #126

Open paulocoutinhox opened 1 year ago

paulocoutinhox commented 1 year ago

Hi,

The current bind code is:

EMSCRIPTEN_BINDINGS(nativium_core_application_core) {
    em::class_<::nativium::core::ApplicationCore>("ApplicationCore")
        .smart_ptr<std::shared_ptr<::nativium::core::ApplicationCore>>("ApplicationCore")
        .function("nativeDestroy", &NTVCoreApplicationCore::nativeDestroy)
        .class_function("shared", NTVCoreApplicationCore::shared)
        .function("multiply", NTVCoreApplicationCore::multiply)
        .function("getVersion", NTVCoreApplicationCore::getVersion)
        ;
}

But on documentation, all functions need have the & symbol.

See on documentation: https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#classes

Can we change to this?

Thanks.