|
|
|
|
|
by staticint
3842 days ago
|
|
Good example. Thanks. > Which is a shame because C macros just aren't good enough. No disagreement here. However, that still perfectly satisfies what may people claim they want in generics, especially those who most frequently trumpet that Go is lacking them. If we took that exact macro and added a little hypothetical syntactical sugar: template<type> type max(type a, type b) {
return a > b ? a : b;
}
max<int>(1, 2);
a lot of people (not everyone) would be very happy, even though there is no theoretical difference at all. I've seen countless proposals for Go generics that do nothing more than that, but have been rejected for obvious reasons. That's where I'm coming from. |
|