google / jni-bind

JNI Bind is a set of advanced syntactic sugar for writing efficient correct JNI Code in C++17 (and up).
Apache License 2.0
244 stars 29 forks source link

Support non-clang consumers #4

Open jwhpryor opened 2 years ago

jwhpryor commented 2 years ago

Currently JNI Bind relies on a clang extension (see invocable_map.h).

InvocableMap should support either compiling with this extension, or compiling with C++20 string literals.

This may force a small change in the calling convention for methods and fields, so this must be done before the initial release to prevent introducing legacy or dual APIs for invocation.

In the future, this will also enable non-JNI consumers.

jwhpryor commented 6 months ago

As best I can tell, there is no way to replicate the logic of QueryableMap.

As of C++20 we can exploit string literals, and provide an API usable by all.