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