4 ms·
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
by simiones 6y ago
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.
- pjmlp 6y agoC++/CLI, C++/CX and Unreal C++ are example of C++ programs that do use some form of GC, just not Boehm.
- simiones 6y agoI 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).