Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Linux kernel contains a lot of C OOP, similar to GTK and other such frameworks.

As soon as you need bindings done during runtime, you will end up with structs containing function pointers as some sort of interface descriptor, and potentially that is embedded or aligned with structs containing data. This is at least OOP class level functions with data they can operate on and if you allocate the "ops" struct (together with data) as well we are talking actual object instances. The Linux kernel is full of such things, plus there are even macros to cast up/down the inheritance tree.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: