简体   繁体   中英

Static field and methods in BREW

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM