My solution I gonna use to add “C++ Extension Methods” to JNI jobjects to make NDK code more readable like (Uniform Function Call Syntax) is:

* Subclass the class that I want to add extension methods.
* For invoking the “Extension Methods” make a pointer of type ExtensionsClass to point to OriginalClass - (Although the pointed object is’nt an ExtensionsClass).

The overload is minimal & we can access public methods of the Original class.

```
#include <iostream>

// Represents a class external to my source
class Person {
public:
    Person(){
        privateage = 20;
    }
    int age() { return privateage; }
private:
    int privateage;
    short anotherField;
};

class PersonExtensions : private Person {
public:
    inline int size() { return 5 + age(); }
    //NoFieldsOnExtensionClass
};

int main() {

    Person person;

    PersonExtensions* pE = (PersonExtensions*) &person;
    std::cout << pE -> size() << std::endl;
    std::cout << (*pE).size() << std::endl;

    std::cout << sizeof(Person) << std::endl;
    std::cout << sizeof(PersonExtensions) << std::endl;

    return 0;
}

```

Do you think that this incorrect pointer assignment, since “Extension Method” only accessed public members of extended class & extension class don’t going to have any Field variables, can represent a problem in the future?
The size of the object are the same.

Thanks a lot.