Posts Tagged ‘clang’

C++11 compiler support shootout: Visual Studio, GCC, Clang, Intel

It’s been more than half a year since my last comparison of the C++11 support across different compilers. This time I’d like to see how different compilers stack up based on the documentation for the pre-release versions of these compilers.

The next release of GCC is 4.8 and the upcoming version of Clang is 3.3. If you use Visual Studio 2012, you can install an experimental CTP update released in November 2012 to get additional C++11 features.

I’ve also thrown in v.13.0 of Intel’s C++ compiler out …

Read More
 

if (arr<:0:> not_eq 0 and not false) – alternative tokens in C++

The line of code in the heading is actually C++. I recently noticed a small section called Alternative tokens in the standard (it’s 2.6, for the curious) which allows this sort of shenanigans.

The following code will probably look slightly alien to you, like a weird C++ knockoff, but it’s a standard conforming C++ program:

%:include

using namespace std;

int main()…

Read More
 

A comparison of C++11 language support in VS2012, g++ 4.7 and Clang 3.1

If you need an excuse for celebration, today happens to be an anniversary! The C++11 standard was approved by ISO on 12 August last year, exactly one year ago. I decided to take a look at the state of C++11 language support one year on across three compilers: the upcoming VS11 (Visual Studio 2012), g++ 4.7 and Clang 3.1.

Please note I didn’t detail the non-language concurrency changes. Generally, support for those remains limited.

FeatureVS11g++ 4.7Clang 3.1

autoYesYesYes
decltypeYesYesYes
Rvalue references and move semanticsYesYesYes
Lambda expressionsYesYesYes
nullptrYesYesYes
static_assertYesYesYes
Range based for loopYesYesYes
Trailing return type in functionsYesYesYes
final method keywordYesYesYes
override method keywordYesYesYes
Strongly typed enumsYesYesYes
Forward declared enumsYesYesYes
extern templatesYesYesYes
>> for nested templatesYesYesYes
Local …

Read More
 
© 2013 Aotea Studios Ltd
The C++ Rocks website and the C++11 Rocks Series are products of Aotea Studios Ltd