3 ms·
Are collisions that common? I've never used namespaces in C++, and they aren't supported in C. And yet the only collisions I've seen between libraries are from
by to3m 14y ago
Are collisions that common?
I've never used namespaces in C++, and they aren't supported in C. And yet the only collisions I've seen between libraries are from un-prefixed identifiers. There's a whole pile of them in the Win32 headers of course. I ended up with a variable called "compress" once, in a function that was calling zlib. And Bink has a U32 or u32 typedef that conflicted with the same one in the code I was working on at the time.
Aside from that, no problems noted - of course, I cannot claim to have seen every program ever, and it is straightforward to engineer problems cases. But if a namespace collision is somehow news, you may assume that they are rarer in practice than you might imagine.