Summary
Reposting a proposal for interfaces in C++.
Advertisement
I wrote an article a while back for the C++ Users Journal which appeared in the September 2004 issue on interface types in C++.
The article was inspired by a proposal which I started but never completed on adding interface types to C++. I abandoned the proposal because the sheer energy required to get a proposal to a point where it would be considered by the C++ committee was too overwhelming for me. My interests also lie more in developing Heron than half-heartedly fighting for new language features in C++.
That having been said, there has been a rejuvenation of interest recently from those who read the proposal or the article and have been asking about it. I decided to post it back online at http://www.heron-language.com/cpp-iop.html for the sake of those interested in developing the work further.
It is worth noting that there is a large interfaces library curently under development by Jonathan Turkanis , with the eventual intention of submission to Boost, which incorporates the ideas in the article and the proposal and develops them significantly. I will make a note of it when the library and documentation is available for perusal online.
Now its just cargo cultism. Just define a class with all pure virtual functions.
I don't see any value in this proposal. Even Gosling has mentioned that the constraint about not allowing any implementation in interfaces was arbitrary and in retrospect maybe didn't need to be so strict.
Now its just cargo cultism. Just define a class with all pure virtual functions.
I don't see any value in this proposal. Even Gosling has mentioned that the constraint about not allowing any implementation in interfaces was arbitrary and in retrospect maybe didn't need to be so strict.
You have already attempted to denigrate my work previously with the same vacuous phrase. Rather than jumping to conclusions you should ask questions to come to a deeper understanding of the implications of something.
> Just define a class with all > pure virtual functions.
Problems:
1) A class implementing an interfaces shouldn't imply virtualism 2) Interfaces have to implemented in advanced 3) A vtable pointer is embedded into an object for every leaf in an inheritance tree 4) Virtual calls can't be inlined
> I don't see any value in this proposal. Even Gosling has > mentioned that the constraint about not allowing any > implementation in interfaces was arbitrary and in > retrospect maybe didn't need to be so strict.
I don't see the bearing this has on the interfaces proposal.
... 1) A class implementing an interface shouldn't imply virtualism of the methods matching the interface 2) Abstract base classes have to be implemented explicitly rather than implicitly as can be done through interfaces ...
Incidentally I think that the Java treatment of interfaces is uninspired is wrong-headed.