4 ms·
Much more usefully, in C++ you can also parametrize over templates, which I think you still can't in rust. You can't parametrize over namespaces (at least not
by gpderetta 5y ago
Much more usefully, in C++ you can also parametrize over templates, which I think you still can't in rust.
You can't parametrize over namespaces (at least not directly) which is an annoying and arbitrary restriction.
- account42 5y ago> You can't parametrize over namespaces (at least not directly) which is an annoying and arbitrary restriction. It's not a restriction, namespaces are neither types nor values so they would need specific support. Given that you can (ab)use classes with static members as namespaces which are also a type it's simply that nobody cared enough to add support for templating over real namespaces.
- gpderetta 5y agoYou are right it is not a restriction in the sense that is explicitly disallowed; what I meant is that it would take very little to add support for parametrizing over namespaces. Stateless structures are a workaround (so is adl driven by a template parameter), still direct support would be nice.