Re: Interfaces in C++
You cant do that. On many platforms interfaces are a binary interop used =
and supported by languages other than c++.
In order to interop however, the vtable for the interface MUST be =
contiguous.
Clearly if you are working in a ahomogonous c++ only environment you can =
use virtual like that. But, despite the c++ standards body being =
unwilling to acknoledge it, c++ vtables *are* used for binary interop =
rendering this keyword worse than useless.
"Maik" <Beckmann.Maik@googlemail.com> wrote in message =
news:f4375d51-1d59-4371-95bd-e7a437664ce3@c60g2000hsf.googlegroups.com...=
On 6 Okt., 21:12, "A.Gallus" <u...@rz.uni-karlsruhe.de> wrote:
Bingo, that did the job, thx!
class A
{
virtual void myfunc() = 0;
};
class B : public A
{
You should consider to prefer
class B : public virtual A
to avoid being bitten by:
=
http://www.parashift.com/c++-faq-lite/multiple-inheritance.html#faq-25.8
which will most likely happen if one uses the interface pattern.
Best,
-- Maik