Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 07-14-2017, 09:33 PM   #16
Zatnikitelman
Addon Developer
 
Zatnikitelman's Avatar
Default

Quote:
Originally Posted by jedidia View Post
 I need it in a few cases to clean up memory. In a tall inheritance tree it's quite a common requirement, actually, especially when working with abstract base classes and multiple inheritance.
I didn't realise that I needed virtual destructors until then, though, and the realisation was not very funny. C++ has quite a few questionable decisions in its syntax, but this one tops it all. Like, I can't imagine any situation where it would be a good thing not to call the destructor of an inheriting class...



A struct knows neither access modifiers nor inheritance. If you consider those matters of "standards and readability", then you did not yet understand what object oriented programming is about
It knows them, it just defaults them to public...so I'm not sure what you're getting at.
Zatnikitelman is offline   Reply With Quote
Thanked by:
Old 07-14-2017, 10:42 PM   #17
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
Originally Posted by Zatnikitelman View Post
 It knows them, it just defaults them to public...so I'm not sure what you're getting at.
My apologies. I did some reading up, and it turns out that structs in C++ do in fact have both access modifiers and inheritance. That astonishes me a bit, I always thought they were mostly there as a relic from C to improve code portability, but it turns out they have been heavily extended when compared to C-structs. Well, I've learned something new, thanks for that!
jedidia is offline   Reply With Quote
Old 07-14-2017, 10:54 PM   #18
Zatnikitelman
Addon Developer
 
Zatnikitelman's Avatar
Default

No worries! Structs have become a little weird in C++, not because of complexities or anything, but because they've effectively become a different name for a class and seem to just exist for backwards compatibility.
Zatnikitelman is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 11:41 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.