3 ms·
But are templates guaranteed to compile without errors for any arguments that match the constraints? If not, then D is in the same situation as C++ with concep
by comex 4y ago
But are templates guaranteed to compile without errors for any arguments that match the constraints? If not, then D is in the same situation as C++ with concepts: there is always the possibility of having to debug errors from the template implementation because the authors didn’t choose precise enough constraints. Rust, Go, Haskell, etc. do guarantee successful compilation, though at the cost of making their generics systems far less suitable for metaprogramming.
- pjmlp 4y agoUnfortunately C++20 only gave us concepts light, however Circle might be getting full concepts as they were originally designed, and those are like Rust, Go, Haskell, etc.
- thechao 4y agoThere's a core contingent of ISO members who don't like (don't understand?) `concept_map`; without late (and layered) binding of types to concepts you're really just rolling out a template prediction scheme.
- pjmlp 4y agoI mainly use C++ on side projects and native library bindings, somehow I think ISO will need to change their ways if they want people to still care about anything past ISO C++23 for green field projects.
- WalterBright 4y ago> there is always the possibility of having to debug errors from the template implementation because the authors didn’t choose precise enough constraints That is indeed possible, but it's hard to see why that is a problem. Any problems would show up at compile time, and fixing errors flagged by the compiler is pretty routine programming work.
- deleted 4y ago[deleted]