Re:Transmission torrent client ported to C++
by lalaland1125 on Sunday September 12, 2021 @05:38PM
(#28505244)
The lack of generics for C makes it difficult to write those sorts of libraries in an efficient way.
[ Parent
| on HN ]
Re:Transmission torrent client ported to C++
by klyrs on Sunday September 12, 2021 @11:16PM
(#28507518)
C has had generics since C11. Can't fault you for not knowing that, as they're a pain to use and I think folks would rather forget that the language feature exists.
Re:Transmission torrent client ported to C++
by edflsafoiewq on Monday September 13, 2021 @12:08AM
(#28507774)
_Generic is basically a switch on typeof(x). Despite the name, it's really a specialization/overloading mechanism.
Re:Transmission torrent client ported to C++
by junon on Monday September 13, 2021 @05:10AM
(#28509244)
Those aren't generics, they're more like overloading.
Re:Transmission torrent client ported to C++
by rwmj on Monday September 13, 2021 @03:20AM
(#28508706)
I wrote this (slightly crazy) generic vector for C: https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/... If you search for "string" in this page you can see how it is used: https://gitlab.com/nbdkit/nbdkit/-/blob/master/plugins/data/...