Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's because templates have no type-checking in C++.

Ideally, you wouldn't be able to do this with concepts, but I don't know whether that's true for the concepts that finally made it into the standard (i.e. I don't know if it would be an error to call a function or operator on an argument if that function isn't required in the concept specification.).



C++ templates have type checking after expansion, the type checking just isn’t modular.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: