Page MenuHomePhabricator

Language And Standards Support
Updated 1,558 Days AgoPublic

NOTE: This document has been flagged for an update. We are supporting C++14 language features now. Standard library features are still restricted by platform portability constraints as mentioned below, so you should use (and request) features in Echo for things like Threading, Networking, FileSystem access etc.

It might be obvious to abstract from APIs to support multiple implementations, for example supporting DirectX and OpenGL would mean your render sub system hides the details of the API that is in use, but less obvious is language and standards support.

Newer versions of the C++ standard include defining language features and standard library features that programmers should be able to expect to be available, however if you want to target exotic platforms not all features will be available.

Why wouldn't language features, such as auto, be available?

If a platform's toolchain is too old language features aren't necessarily going to be available. We've dealt with this by restricting the language version that we officially support (we're still testing but it should officially be C++11 soon). We can also make it appear as though we have more keyword support than we do, for example #define override allows us to use override where you would normally use it even if the keyword doesn't exist, however it doesn't provide any compile checks and doesn't stop you using it in the wrong place.

Why can't I just use std::thread, it is standard after all, isn't it?

Yes, it is a standard, but not all standard library features are available with all tool chains. Threading is an easy example because I happened to be attempting to do something with it recently. Threading support on the Wii is provided through libogc and std::thread,std::mutex etc are not available. Echo provides basic abstractions threading to solve this problem. The implementation isn't as comprehensive as what is available in the standard but if a feature you need is missing then please request or add it yourself.

So basically, this means that we're not on the cutting edge of C++ language support since toolchains aren't always up to date.

This page is designed to give you an idea of what is available. There are three tables, language version support, standard library features, and boost support. Please update this document if you find an error.

NOTE: Since the C++ version on PC depends on your compiler version some features may vary a little. You should consult the documentation for your platform;'s compiler to find out what it supports for a comprehensive list.

Status of GCC CXX lanauge support

Language version support (not std library) vs compiler versions

TargetCompilerLanguage
LinuxGCC 4.8.2C++11
WindowsGCC 4.8.2 (mingw32)C++11
OSXGCC 4.8.2C++11
Android 2.3 api-9GCC 4.8most of C++11
Android 4.4 api-19TBDProbably C++11
iOSGCC 4.8.2C++11
WiiGCC 4.8.2C++11

Cells with "?" need to be determined. This isn't a complete list.

Standard library features (std)

LinuxAndroid 2.3WiiWindows
STLyesyesyesyes
Threadingyes?no?
Tuples????
Hash tables????
Regular expressions????
Smart pointersyesyesyesyes
Wrapper ref????
Random numbers????
Type traits????
...

Cells with "?" need to be determined. This isn't a complete list, since a lot of boost libraries are header only and don't depend on external libraries most libraries will work.

Boost library support

LinuxAndroid 2.3WiiWindows
bindyesyesyesyes
chronoyesyesyesyes
DateTimeyesyes?yes
functionyesyesyesyes
fusionyesyesyesyes
filesystemyesnonoyes
Smart pointersyesyesyesyes
For each pointersyesyesyesyes
lexical castyesyesyesyes
optionalyesyesyesyes
regexyesyesyesyes
threadyes?no?
timeryesyesyesyes
...
Last Author
0xseantasker
Last Edited
Jan 22 2020, 10:51 PM

Event Timeline

0xseantasker edited the content of this document. (Show Details)
0xseantasker changed the visibility from "All Users" to "Public (No Login Required)".Mar 6 2019, 4:46 PM