Orbiter-Forum  

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

Orbiter Beta Topics related to Beta releases of Orbiter and Orbiter development.

Reply
 
Thread Tools
Old 03-28-2015, 03:47 PM   #1
TCR_500
Biblical Creationist
 
TCR_500's Avatar
Default C++11/C++14 Compliance

There have been some changes to the C++ standards since Orbiter 2010 and the current Beta does not meet those standards. Namely, it uses character arrays rather than std::string and generic pointers instead of std::unique_ptr, std::shard_ptr, etc., and (I think) uses old, compiler-specific threading systems instead of std::thread.

Could these be phased-in as the beta development progresses so that Orbiter will be 100% compliant with at least the C++11 standard by the time that it is released?
TCR_500 is offline   Reply With Quote
Old 03-28-2015, 04:00 PM   #2
RisingFury
OBSP developer
 
RisingFury's Avatar
Default

No.

Even if someone were to spend the time it'd take to replace every pointer, thread and string in the Orbiter API, then just about every addon would break.
RisingFury is offline   Reply With Quote
Old 03-28-2015, 04:15 PM   #3
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Aren't all C++ standards backwards compatible to any thinkable compiler created since the last standard anyway
Urwumpe is online now   Reply With Quote
Old 03-28-2015, 04:48 PM   #4
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by TCR_500 View Post
 Could these be phased-in as the beta development progresses so that Orbiter will be 100% compliant with at least the C++11 standard by the time that it is released?
What exactly do you mean with "Orbiter"? What do you mean with "compliant"? Why would you want this?
Face is offline   Reply With Quote
Old 03-28-2015, 04:58 PM   #5
BruceJohnJennerLawso
Dread Lord of the Idiots
 
BruceJohnJennerLawso's Avatar
Default

Quote:
Originally Posted by RisingFury View Post
 No.

Even if someone were to spend the time it'd take to replace every pointer, thread and string in the Orbiter API, then just about every addon would break.
Although it would be nice to be able to use std::string instead of char*.

But no question, the API is way too big for any major changes like that at this point.
BruceJohnJennerLawso is offline   Reply With Quote
Old 03-28-2015, 05:15 PM   #6
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by BruceJohnJennerLawso View Post
 Although it would be nice to be able to use std::string instead of char*.

But no question, the API is way too big for any major changes like that at this point.
Of course it would also be possible to add another function with the appropriate signature calling the legacy function internally. Why does it have to be exchanged at all? Why breaking something for the sake of being different?

I don't get the "compliance" bit here. Is it just so some compliance tool or compiler warning level gives you a green light?

Next stop: systemd for Orbiter
Face is offline   Reply With Quote
Thanked by:
Old 03-28-2015, 05:15 PM   #7
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by Face View Post
 Next stop: systemd for Orbiter
You are evil. Really.
Urwumpe is online now   Reply With Quote
Thanked by:
Old 03-28-2015, 05:16 PM   #8
orb
O-F Administrator
Ninja
 
orb's Avatar

Default

Quote:
Originally Posted by BruceJohnJennerLawso View Post
 Although it would be nice to be able to use std::string instead of char*.
But you can use std::string in Orbiter modules just fine, you just need to convert it from and to char* for the API calls.
orb is offline   Reply With Quote
Old 03-28-2015, 05:18 PM   #9
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Remember that C++ std::string and char* are two completely different concepts.

string is slow and comfortable.

char* is fast and bites the hand that feeds it.
Urwumpe is online now   Reply With Quote
Old 03-28-2015, 05:27 PM   #10
BruceJohnJennerLawso
Dread Lord of the Idiots
 
BruceJohnJennerLawso's Avatar
Default

Quote:
Originally Posted by Face View Post
 I don't get the "compliance" bit here. Is it just so some compliance tool or compiler warning level gives you a green light?
I dont either really, most of the concerns listed in the OP are basically non-issues. Things like character arrays and standard pointers are completely impossible to remove from C++ without breaking, well everything, and if it uses a compiler specific feature, it doesnt really matter, because Martins has made it clear that Orbiter will be Windows only since forever, so as MSVC goes, Orbiter goes.

Quote:
Originally Posted by Face View Post
 Next stop: systemd for Orbiter
Oh man, please dont even mention that

---------- Post added at 17:27 ---------- Previous post was at 17:22 ----------

Quote:
Originally Posted by Urwumpe View Post
 Remember that C++ std::string and char* are two completely different concepts.

string is slow and comfortable.

char* is fast and bites the hand that feeds it.
I know, but I prefer to have hands

Its just a strong preference of mine to prefer the more modern conveniences in programming. Stuff like manually handling dynamic arrays and mucking about with pointers is an interesting exercise when learning C, but after a while its nice to just not deal with those interesting problems and make stuff. But Im dragging us off topic here, so Ill shut up.
BruceJohnJennerLawso is offline   Reply With Quote
Old 03-28-2015, 05:42 PM   #11
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by BruceJohnJennerLawso View Post
 Its just a strong preference of mine to prefer the more modern conveniences in programming. Stuff like manually handling dynamic arrays and mucking about with pointers is an interesting exercise when learning C, but after a while its nice to just not deal with those interesting problems and make stuff. But Im dragging us off topic here, so Ill shut up.
Yeah, but I prefer choosing the solution that works best for the problem I have... and not fit my problems to my favorite solution*.

* Nanothermite
Urwumpe is online now   Reply With Quote
Thanked by:
Old 03-28-2015, 08:45 PM   #12
ADSWNJ
Scientist
 
ADSWNJ's Avatar
Default

Quote:
Originally Posted by Urwumpe View Post
 Remember that C++ std::string and char* are two completely different concepts.

string is slow and comfortable.

char* is fast and bites the hand that feeds it.
I think it's the std::string that bites the unaware user, when passed across modules that are implemented under different versions of the standard library. Enjo and I saw this for real with ModuleMessaging early on between his code and mine, due to a different MSVC.

For OP - note that there is absolutely no requirement in C++ to use the std library if you don't want to, so it's incorrect to state it as non-compliant to use char* or whatever you like from the lexical capabilities of the language.
ADSWNJ is offline   Reply With Quote
Old 03-28-2015, 09:01 PM   #13
TCR_500
Biblical Creationist
 
TCR_500's Avatar
Default

Not according to these articles on C++: [http://www.lb-stuff.com/cc] [http://www.lb-stuff.com/pointers]
TCR_500 is offline   Reply With Quote
Old 03-28-2015, 09:07 PM   #14
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by TCR_500 View Post
 Not according to these articles on C++: [http://www.lb-stuff.com/cc] [http://www.lb-stuff.com/pointers]
Those are all 404 errors.
Urwumpe is online now   Reply With Quote
Thanked by:
Old 03-28-2015, 10:03 PM   #15
kuddel
Donator
Default

Quote:
Originally Posted by Urwumpe View Post
 Those are all 404 errors.
Not if you remove the trailing bracket (])
So : http://www.lb-stuff.com/cc and http://www.lb-stuff.com/pointers
kuddel is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter Beta


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:26 PM.

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.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.