Since typeid is applied to the type, and not to the object, there is no information about the type of runtime, so overhead will not be a problem.
On the other hand: as far as I can tell, there are no requirements in the standard as to when the value will be determined, so there is no guarantee that the overhead will not be met.
Edit:
Of course, the fact that there is (possibly) no guarantee does not mean that this is not a reasonable assumption.
I cannot imagine anyone writing a compiler that did not evaluate typeid(T) at compile time.
source share