Static field and methods in BREW

50 Views Asked by At

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

1

There are 1 best solutions below

0
hate-engine On BEST ANSWER
  • 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.