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

If C gets operator overloading and RAII, there will be no good reason to use C++ for me!!


Only operator overloading is really important and would cut down the size of code written substantially. Thats the only real advantage of using C++ vs C. Everything else oop, function overloading,RAII,etc can be replaced with macros and structs.


Pretty sure you can't make destructors with macros?



Is RAII in C a serious suggestion being made anywhere?


GCC has it as an extension. See the cleanup attribute:

https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attribute...


It is meaningless without destructors and exceptions.




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

Search: