
10 Jan
2009
10 Jan
'09
5:15 a.m.
On Jan 9, 2009, at 4:21 PM, David Abrahams wrote:
on Fri Jan 09 2009, "Simonson, Lucanus J" <lucanus.j.simonson-AT- intel.com> wrote:
I implemented the above hierarchy as struct pwh{}; struct p : pwh{}; struct p45wh : pwh{}; struct p45 : virtual p, p45wh {}; struct p90wh : p45wh; struct p90 : virtual p45, p90wh {}; But wasn't keen on a virtual pointer in a tag, so took out virtual keyword.
Yeah, you shouldn't need it.
Interestingly, virtual inheritance of tags shouldn't have any runtime cost. There's an interesting example in the Templates Complete Guide which uses virtual inheritance for a default policy scheme. For the same reason (never instantiated) not necessary here.