#pragma once #include #include #include #include #include namespace jni { template < class TheTag, class T > class Field { private: jfieldID& field; public: using TagType = TheTag; using FieldType = T; Field(JNIEnv& env, const Class& clazz, const char* name) : field(GetFieldID(env, *clazz, name, TypeSignature()())) {} operator jfieldID&() const { return field; } }; }