The compiler couldn't know that there won't ever be a child class with two
(or more) virtual functions, so this optimization would be incorrect, or
at least silly. Should that child class have two function pointers, or
a function pointer and a vtbl pointer? It can't have just the one vtbl
to preserve compatibility with objects of its parent class. What if the
child class (with two inline function pointers) had a child class which
added more virtual functions, what goes then? Two pointers and a vtbl
pointer? Where does it end?
Usually the right answer to "where does it end" is "it doesn't start".
Keith (does C++ have a keyword to do that manually?)
-- "Well, look at that. The sun's | Linux: http://www.linuxhq.com |"Zooty, coming up." -- John Sheridan, | KDE: http://www.kde.org | zoot "Sleeping in Light", Babylon 5 | Keith: kwrohrer@enteract.com | zoot!" www.midwinter.com/lurk/lurker.html | http://www.enteract.com/~kwrohrer | --Rebo- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/