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

It could, but it won't. If we're talking about real-world use, this makes all the difference.

C or C++ could have a GC as well (in fact, they do - you can use Boehm for any C or C++ program), but there are approximately 0 programs that do.



C++/CLI, C++/CX and Unreal C++ are example of C++ programs that do use some form of GC, just not Boehm.


I didn't know about Unreal C++ using a GC, but the others have extremely little use. So little, that C++/CLR (at the time) had a bug for at least 2 years where doing something like initializing a CLR List (CLR, not std::) with an initializer list (I have forgotten the exact syntax, but it is similar to `auto lst = new List<int>{a, b}`) would allocate millions of elements on the heap (if I remember correctly, it would create a List of size 0xC0FFEE, or maybe it was 0xDEADBEEF - either way, obvious debug code, then set list[0]=a and list[1]=b).




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

Search: