3 ms·
T{} is now sort of that, but it didn't exist yet when adjacent_difference was written.
by plorkyeran 1y ago
T{} is now sort of that, but it didn't exist yet when adjacent_difference was written.
- tialaramex 1y agoSort of. T {} is IIUC C++ "zero initialization" but this doesn't actually promise to give us the zero (additive identity) of T but instead to basically smash all T's constituent elements to zero which may not have that effect. This does what you meant for simple types like the signed integers or floats at least.