C++

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36
Contact:

C++

Post by Nauk »

I had some good laughs reading this, so I thought I'd share it:
http://harmful.cat-v.org/software/c++/

and the (fake) interview with Bjarne Stroustrup:
http://harmful.cat-v.org/software/c++/I ... or_you_all

Enjoy :D
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: C++

Post by KungFooMasta »

If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private destructor and when was the last time you needed one?


:lol:

Actually I wish C++ had a lot more functionality, like forcing every derived class to implement a particular function, for example.
Creator of QuickGUI!
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: C++

Post by CABAListic »

Heh, yeah, nice list :D

@kungfoo: Could you elaborate on that, more specifically in what way pure virtual functions don't do what you just described? I'm slightly confused :)
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: C++

Post by KungFooMasta »

Pure virtual functions only force the first derived class to implement the function. For example, if I have a "toString" function for each class, that returns the name of the class, and I want it to be a hardcoded value, not a string that can be altered or mis-used, I want every class to implement their own "toString" function.

class A;
class B : public A;
class C : public B;

I want the compiler to complain if there isn't the following:

A::toString
B::toString
C::toString
Creator of QuickGUI!
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: C++

Post by CABAListic »

Why would a class in the middle of your hierarchy implement such a function? I'd say only concrete classes would need an implementation, but the general recommendation is to have concrete classes at the end of your hierarchy only. Concrete classes in the middle of a hierarchy mix interface and implementation which I think should be avoided.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Re: C++

Post by Kencho »

Java is, in many ways, C++--
That's the best statement I've ever read :lol:
Image
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: C++

Post by Klaim »

Post Reply