[FoRK] C++11: CLANG feature complete, g++ close

Stephen Williams sdw at lig.net
Sat Apr 20 15:59:58 PDT 2013


Already integrated quite a bit in Qt 5:
http://woboq.com/blog/cpp11-in-qt5.html

>
>     Lambda expressions for slots
>
> Lambda expressions <http://en.wikipedia.org/wiki/Anonymous_function#C.2B.2B> are a new syntax in C++11 which allow to declare 
> anonymous functions. Anonymous functions can be used in order to use small functions as parameter without requiring to 
> explicitly declare them.
> The previous way to write functors <http://en.wikipedia.org/wiki/Function_object#In_C_and_C.2B.2B> using operator() in a 
> struct was requiring a lot of boilerplate code.
>
> It was already possible in Qt 4.8 to use lambda expressions in some QtConcurrent functions. Now it is even possible to use 
> them as slots using the new connect syntax <http://woboq.com/blog/new-signals-slots-syntax-in-qt5.html>.
>
> Remember the time when you had to write a one-line function for your slot. Now you can write it right in place. It is much 
> more readable to have the function directly where you reference it:
>
> |connect||(sender, &Sender::valueChanged, [=](||const| |QString| |&newValue) {|
> |||receiver->updateValue(||"senderValue"||, newValue);|
> |||});|
>
> Lambda functions are supported since MSVC 2010, GCC 4.5, and clang 3.1.
>
>
>     Unicode literal
>
> In C++11, you can generate UTF-16 by writing |u"MyString"|. This is used by Qt to implement QStringLiteral which is a macro 
> that initializes the QString at compile time without run-time overhead.
>
> |QString| |someString = ||QStringLiteral||(||"Hello"||);|
>
> See my previous blog about QStringLiteral <http://woboq.com/blog/qstringliteral.html>.
>


On 4/20/13 3:54 PM, Stephen Williams wrote:
> Nice.
>
> http://www.phoronix.com/scan.php?page=news_item&px=MTM1NTg
>
>
>  LLVM's Clang Compiler Is Now C++11 Feature Complete
>
>
>    Posted by Michael Larabel on April 19, 2013
>
> The Clang C/C++ compiler front-end to LLVM is now declared "feature complete" against the C++11 ISO 
> <http://www.phoronix.com/scan.php?page=news_item&px=MTM1NTg#> standard.
>
> With a SVN/Git commit <https://github.com/llvm-mirror/clang/commit/e6e68b53778bb5a15c10a73a5bf18d8ab73f75e3> made today, the 
> C++11 support within the LLVM/Clang compiler <http://www.phoronix.com/scan.php?page=news_item&px=MTM1NTg#> is now deemed 
> "feature complete" with all of the new features to the ISO-approved C++ language update having been implemented.
>
> The last of the C++11 features to be implemented were support for inheriting constructors, and C11/C++11 thread_local. C++11 
> support has been a very active work <http://www.phoronix.com/scan.php?page=news_item&px=MTM1NTg#>-in-progress item for the 
> past several Clang releases. It's been nearly complete <http://www.phoronix.com/scan.php?page=news_item&px=MTMwOTU> for 
> several months but only with the latest LLVM/Clang 3.3 SVN code are all of the features officially implemented.
>
> By Intel developers <http://www.phoronix.com/scan.php?page=news_item&px=MTM1NTg#> there has also been a project forming that 
> supports automatically converting C++ code into C++11 <http://www.phoronix.com/scan.php?page=news_item&px=MTM1MTk> to take 
> advantage of new features.
>
> Finishing off this support comes at a time when many open-source projects are beginning to use C++11 
> <http://www.phoronix.com/scan.php?page=news_item&px=MTIzNjM>. LLVM developers have also looked at using some C++11 features 
> <http://www.phoronix.com/scan.php?page=news_item&px=MTI3MDM> within the compiler itself.
>
> For those unfamiliar with the C++11 language features, there is a Wikipedia article <http://en.wikipedia.org/wiki/C%2B%2B11> 
> and the ISO.org specification <http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372>.
>
> Meanwhile, in terms of support for GCC (the GNU Compiler Collection 
> <http://www.phoronix.com/scan.php?page=news_item&px=MTM1NTg#>) supporting C++11, it's nearly complete. The GCC C++11 state is 
> reflected on this web-page <http://gcc.gnu.org/projects/cxx0x.html>. Most functionality of C++11 is implemented within the 
> recent release of GCC 4.8, but still to be complete is minimal support for garbage collection and reachability-based leak 
> detection, some data-dependency ordering, and a few other small items.
>
> LLVM/Clang 3.3 <http://www.phoronix.com/scan.php?page=search&q=LLVM+3.3> will be the first compiler release with full C++11 
> support and its release is expected in June <http://www.phoronix.com/scan.php?page=news_item&px=MTM0MTA>. Besides finishing up 
> the C++11 support, LLVM 3.3 and Clang 3.3 also provides dramatic performance improvements 
> <http://www.phoronix.com/vr.php?view=18656>, better Intel AVX2 support 
> <http://www.phoronix.com/scan.php?page=news_item&px=MTMzODc>, the AMD R600 GPU LLVM back-end 
> <http://www.phoronix.com/scan.php?page=news_item&px=MTMxOTE>, enhancements to its loop vectorizer 
> <http://www.phoronix.com/scan.php?page=news_item&px=MTMwMTk> (and enabled by default for /-O3/), and numerous other new 
> features and optimizations.


-- 
Stephen D. Williams sdw at lig.net stephendwilliams at gmail.com LinkedIn: http://sdw.st/in
V:650-450-UNIX (8649) V:866.SDW.UNIX V:703.371.9362 F:703.995.0407
AIM:sdw Skype:StephenDWilliams Yahoo:sdwlignet Resume: http://sdw.st/gres
Personal: http://sdw.st facebook.com/sdwlig twitter.com/scienteer



More information about the FoRK mailing list