Let me start with explaining what I mean with "magic". I will use two examples from Java:
- Every class inherits (directly or indirectly) the
Object
class. - Operator overloading is not supported by Java but the
+
operator is defined forString
objects.
This means that it is impossible to make an implementation of the Object
and String
classes in pure(*) Java. Now this is what I mean with "magic": to make an implementation of these classes, you will need some special support from the compiler.
What I always liked about C++ is that, as far as I know, there is no such "magic" going on in the STL, i.e. it is possible to implement the STL in pure C++.
Now my question is: is this true? Or are there parts of the STL that cannot be implemented in pure C++ and need some "magic"/special compiler support?
(*) With "pure" I mean without using any class libraries.