The Artima Developer Community
Sponsored Link

Weblogs Forum
C++ Interfaces

4 replies on 1 page. Most recent reply: Nov 11, 2004 7:00 AM by Christopher Diggins

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

C++ Interfaces (View in Weblogs)
Posted: Oct 29, 2004 12:10 PM
Reply to this message Reply
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.


Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

You already have them Posted: Nov 10, 2004 11:22 AM
Reply to this message Reply
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.

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

You already have them Posted: Nov 10, 2004 11:50 AM
Reply to this message Reply
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.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: You already have them Posted: Nov 11, 2004 6:56 AM
Reply to this message Reply
> Now its just cargo cultism.

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.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: You already have them Posted: Nov 11, 2004 7:00 AM
Reply to this message Reply
Corrections to earlier post:

...
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.

Flat View: This topic has 4 replies on 1 page
Topic: Constrained Value Types using Policies in C++ Previous Topic   Next Topic Topic: Comparative Studies – the rods we hit each other with?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use