• Forum
  • Lounge
  • C++ 17 as an alternative to using OS API

 
C++ 17 as an alternative to using OS API

Jun 27, 2015 at 7:53am
C++ 11 brought us closer to the operating system without having to directly use the operating system's API with the C++ Thread support library. Now C++ 17 is going to include a File system support library and a Networking support library.

What I'm trying to say is that in my opinion it is the programming language that should give you access to the resources of an operating system rather than the API because that way you can write truly platform independent code as apposed to using cross-platform libraries. What's your opinion?
Last edited on Jun 27, 2015 at 7:54am
Jun 27, 2015 at 12:37pm
My opinion is that nine times out of ten the OS API is going to be faster due to lack of abstraction... However the standard libraries are likely to just implement those API and chances are good that the programmers of the standard library are going to be much more adept at writing efficient code than you or I am. So I guess I'm conflicted on it.
Jun 27, 2015 at 12:57pm
You say
truly platform independent code as opposed to using cross-platform libraries
are you saying that using libraries such as SFML that are multi-platform is not platform independent? After all, any C++ standard library that uses platform specific code within itself will not automatically work on a new operating system if it wasn't designed to. What I'm saying is if these libraries will be better than current multi-platform libraries then good, but as they surely won't be conclusively better, they're just more libraries in a growing list of libraries to do that task and we can't know whether they should be used over pre-existing libraries until they are released.
Jun 27, 2015 at 1:03pm
if these libraries will be better than current multi-platform libraries then good
I must say that they most likely will be one of the existing multiplatform libraries. Filesystem library is boost::filesystem brought into standard.

@benbalach any links to Networking lib inclusion in C++17?
Last edited on Jun 27, 2015 at 1:04pm
Jun 27, 2015 at 2:13pm
File System Technical Specification is published: http://www.iso.org/iso/catalogue_detail.htm?csnumber=63483
Final Draft: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf
Reference: http://en.cppreference.com/w/cpp/experimental/fs

Networking TS is still under development.
Draft: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4478.html

Status of other std::experimental libraries is available here: http://en.cppreference.com/w/cpp/experimental
Jul 20, 2015 at 6:52am
I wouldn't be surprised if both of these additions are from the boost libraries, they've already adopted a fair amount from boost, and the filesystem seems like a perfectly good library when I've been using it for small things...

I believe boost also has networking in boost.asio?

Either way I can't see this being a bad thing, if anything it means more programmers are going to use the same libraries and better understand each others code by relying on the standard libraries instead of each programmer wanting to include their own preferred 3rd party libraries.
Jul 21, 2015 at 3:42am
Visual Studio 2015 released several hours ago, and apparently has support for the filesystem "V3" TS:
http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
Topic archived. No new replies allowed.