3 ms·
Yeah, same in the C++ world with templates. They're just so handy, especially when you want performance! Thankfully C++'s `constexpr` has made this kind of thin
by bjz_ 9y ago
Yeah, same in the C++ world with templates. They're just so handy, especially when you want performance! Thankfully C++'s `constexpr` has made this kind of thing much more tenable from a library consumer's perspective, and Rust will again be following in its footsteps, albeit with a less adhoc version based on dependent types.
For what its worth, my cgmath library just has a bunch of hardcoded `Vector{2,3,4}`, `Point{2,3}`, and `Matrix{2,3,4}` types.
- seanmcdirmid 9y agoYa, that like is familiar. In C#, you can declare class D4 : Dim<D3,D4,D5> ...., and then use extension methods to access the D3 and D5 type parameters as previous and next dimensions. It all was nice and f-bounded as well. C# is an under appreciated language for these kinds of things.