struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Petrelli" <antonio.petre...@gmail.com>
Subject [OT] C++ interfaces (WAS: Re: StrutsStatics...)
Date Fri, 29 Feb 2008 20:19:33 GMT
2008/2/29, CleverSwine <cleverswine@fastmail.fm>:
>
>
>  Antonio Petrelli wrote:
>  > Err... Does C++ have interfaces at all? All I recall is that C++ has
>  > classes.
>
>
> Of course it does. A simple google search
>  (http://www.google.com/search?hl=en&q=C%2B%2B+interfaces&btnG=Google+Search)
>  would have shown you. Perhaps you're thinking of C.

The first result:
http://www.codeguru.com/cpp/cpp/cpp_mfc/oop/article.php/c9989/
Contains this piece of code:

<snip>
#define Interface class

#define DeclareInterface(name) Interface name { \
          public: \
          virtual ~name() {}

#define DeclareBasedInterface(name, base) class name :
        public base { \
           public: \
           virtual ~name() {}

#define EndInterface };

#define implements public
</snip>

So I was right, C++ does not have interfaces, it uses only a trick to use them!
I think this is definitely a candidate for thedailywtf.com :-D

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message