News for hackers. Stuff that matters.
Re:Deep C and C++ (2011) by nly on Wednesday October 23, 2013 @08:15PM (#6602656)
You can't make a member function template virtual because it's just a template, the function doesn't exist until it's statically instantiated. Instantiation can happen across units of compilation, making it impossible for the compiler to generate a vtable with all the instantiations within it. It's not a "tacked on" feature/limitation at all, and I don't see how any statically typed language that allowed function overloading could really work around that issue.

I'm not sure what you mean about the operator overloading thing.

Re:Deep C and C++ (2011) by pkolaczk on Thursday October 24, 2013 @04:02AM (#6603904)
This was a rhetoric question. I perfectly know why I can't do that in C++. C++ does not allow this because of particular generics implementation (done by static compile-time macro expansion), not because those two features are inherently contradictory. In fact, they are completely orthogonal and Java/Scala/C# have no problems with that, despite being statically typed.