Вопрос

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

Это было полезно?

Решение

  • 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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top