Question

It's possible to create and use static fields and methods in BREW? I'm writting in c++

Was it helpful?

Solution

  • Static methods: OK, it's like simple free-standing function with extra access rights.

  • Static field: only POD (still use with caution). BREW runtime doesn't call constructors for global variables and static fields (which almost the same, except for access permissions and namespacing), therefore any initialization will fail.

Note that singletons will work (static instance pointer is POD), so you have to use them instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top