How is cross platform a standard C ++ library?

Is the standard C ++ library (e.g. stream std :: string) available on iOS and Android (using JNI / NDK)? If yes:

To what extent is this supported? What are the features of a desktop such as a console? How fast / reliable is it? How many other mobile platforms are available? Can I expect that you do not have to modify a lot of code using the std library when porting to mobile platforms (for example, iOS)?

+4
source share
2 answers

The standard C ++ library is available for both. In addition, iOS has had C ++ 11 for quite some time.

Both platforms, mainly based on POSIX, have the concept of console I / O, but none of them provide access to it in the user interface, and none of them can (at least out of the box) launch the console application directly.

As a result, it is obvious that you cannot use console I / O for any interaction with your application - unless this is the case, you create it using the platform user interface API.

There shouldn't be a problem in terms of portability on both platforms - this is the GNU Std g ++ library on Android and the Clang C ++ library on iOS. Portability is not a problem for iOS, but you will probably be interested in creating JNI bindings for Android.

In fact, you will only ever be able to create back-end applications in C ++. All user interfaces will be clearly not portable and, as a rule, should be implemented in the user interface language.

Windows Phone 8 allows native applications, while C ++ seems to be the language of choice for their implementation. BlackBerry OS 10 is the fundamental QNX under the hood, which is also POSIX compatible.

+2
source

As far as I can tell, standard libraries should be standard across all platforms. Now their internal implementation may vary, but they must fulfill the task for which they were introduced.

Usually std lib is very efficient, fast and well tested, so it should be reliable.

The actual catch is that std lib should be included in the C ++ implementation, but it depends entirely on the provider implementing C ++ whether std lib is enabled or not. Even if they do not include std lib, there is a good chance that you can find an alternative implementation for this platform. Then all you have to do is link this library with your code.

Assuming there is a C ++ compiler supporting basic functions.

Even if this is not possible, you can always port the necessary std functions to this particular platform as a user library.

Hope this helps,

+1
source

Source: https://habr.com/ru/post/1488689/


All Articles