Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax support for "cxx::" prefix for c++ binding types. For example using cxx::UniquePtr instead of UniquePtr. #1308

Open
tolvanea opened this issue Jan 19, 2024 · 0 comments

Comments

@tolvanea
Copy link

I think it could prevent confusion if c++ binding types could be written with "cxx::" module perfix in the extern blocks.
For example, in the Blobstore example we have

unsafe extern "C++" {
    include!("demo/include/blobstore.h");
    type BlobstoreClient;
    fn new_blobstore_client() -> UniquePtr<BlobstoreClient>;
    ...
}

If one writes the return type of new_blobstore_client() with cxx::UniquePtr<BlobstoreClient> instead, there is compilation error "unsupported type". Users may think cxx::UniquePtr to be the correct way write the type, because cxx namespace has not been opened up with use cxx::*;. The error message may misslead newcomers into thinking that there is something in their current interface design that is not supported by cxx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant