Product News

Qt Creator 2.7.0: More C++11, and C++11 Now Default

Qt Creator 2.7.0 is now available, and includes more C++11 support including that C++11 mode is now on by default.

Qt Creator 2.7.0 Released

by Eike Ziller

C++ support in Qt Creator got even more improvements for C++11, like handling of alignof, alignas and noexcept, brace initializers, and more lambda fixes. Also, if Qt Creator cannot find out if your tool chain expects C++11 or C++98/03, it defaults to C++11 now, for a better out of the box experience.

GCC's Move to C++ -- Linda Jacobsen

It's nice to see more C++ compilers being written in C++ rather than C. The Clang compiler is already all-C++. In recent years GCC has been slowly doing the same -- first compiling the C code as C++ code, and more recently using C++ itself.

Here is a readable summary of progress to date.

GCC's Move to C++

by Linda Jacobsen

Excerpt:

In 2008, 2009, and 2010, (i.e., at the beginning and after each milestone) Taylor provided formal plans for the next steps. There is no formal plan going forward from here. People will use C++ constructs in future patches as they deem necessary, but not just for the sake of doing so. Some will limit their changes to the times when they are patching the code anyway. Others approach the existing C code with an eye to converting code to C++ wherever it makes the code clearer or more efficient. Therefore, this is an ongoing effort on a meandering path for the foreseeable future.

GCC 4.8 released

GCC 4.8 has been released. C++-related improvements include the following highlights.

Language improvements:

  • G++ now implements the C++11 thread_local keyword...
  • G++ now implements the C++11 attribute syntax, e.g.
      [[noreturn]] void f();
    and also the alignment specifier, e.g.
      alignas(double) int i;
  • G++ now implements C++11 inheriting constructors, e.g.
      struct A { A(int); };
      struct B: A { using A::A; }; // defines B::B(int)
      B b(42); // OK
  • G++ now supports a -std=c++1y option for experimentation with features proposed for the next revision of the standard, expected around 2017. Currently the only difference from -std=c++11 is support for return type deduction in normal functions, as proposed in N3386.
  • The G++ namespace association extension, __attribute ((strong)), has been deprecated. Inline namespaces should be used instead.

Standard library improvements:

Improved experimental support for the new ISO C++ standard, C++11, including:

  • forward_list meets the allocator-aware container requirements;
  • this_thread::sleep_for(), this_thread::sleep_until() and this_thread::yield() are defined without requiring the configure option --enable-libstdcxx-time;
  • SSE optimized normal_distribution and simd_fast_mersenne_twister_engine.
  • Use of hardware RNG instruction for random_device on new x86 processors (requires the assembler to support the instruction.)

C++11 Compiler Support Shootout -- Alex Korban

C++11 compiler support continues to grow across the industry, with leaders and laggards still all moving in the C++11 direction.

C++11 Compiler Support Shootout: Visual Studio, GCC, Clang, Intel

by Alex Korban

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.

...

Runtime-Compiled C++ -- "Edit and Continue"++ for MS VC++, gcc, Clang/LLVM

Very cool work:

Runtime-Complied C++ blog

This technique allows you to change your C++ code while it's running.

It uses no scripting, no VM, no external tools -- you can apply it to your own code and you can continue to use your favourite IDE. We think the quit-recompile-restart-reload cycle we're all used to could soon be a thing of the past.

If this is your first visit, watch the teaser video on the left.

If you want to know more, start here

dougbinks writes on the Reddit comment thread:

Compiling and loading code at runtime certainly isn't new, but what we're trying to do is develop a permissive open source portable and standard C++ solution which makes it easy to use. Cling is another similar project, but it uses compiler changes to LLVM so you need to use that compiler, whereas our solution requires only small changes to get it working with any compiler (currently supporting Visual Studio, gcc, clang/llvm).

C++ to JavaScript with Emscripten

Want to run your C++ code in a browser? Check out this project that converts LLVM bitcode to JavaScript™. From the project homepage:

Emscripten is an LLVM to JavaScript™ compiler. It takes LLVM bitcode (which can be generated from C/C++ using Clang, or any other language that can be converted into LLVM bitcode) and compiles that into JavaScript™, which can be run on the web (or anywhere else JavaScript™ can run).

Using Emscripten, you can

  • Compile C and C++ code into JavaScript™ and run that on the web
  • Run code in languages like Python as well, by compiling CPython from C to JavaScript™ and interpreting code in that on the web

They even have Qt demos running!

Continue reading...

Image Watch: C++ image and video debugging plug-in for VS 2012

We continue to see modern C++ tool development across the industry continue apace. Here's another new cool C++-oriented tool with a nice seven-minute video on Channel 9:

Introducing Image Watch - A VS 2012 Plug-In for C++ Image and Video Debugging

Image Watch is a new Visual Studio 2012 plug-in for debugging C++ image and video processing applications, for example photo or augmented reality apps. Image Watch provides a watch window that can display in-memory bitmaps during debugging, so you no longer need to litter your code with "save-this-intermediate-image-to-a-file" statements when tracking down bugs. The initial release has built-in support for OpenCV image types and can be extended for viewing user-defined image types as well.

Here, Wolf Kienzle, Senior Research Developer, Interactive Visual Media group, Microsoft Research Redmond, explains and demos this excellent new tool for C++ developers building image, video or augmented reality apps. In effect, you can step into pixels...

Microsoft releases C++ REST SDK ("Casablanca")

From the announcement:

The C++ REST SDK (codename "Casablanca") has officially been released as an open source project on CodePlex...

We first announced Casablanca as an incubation project on Microsoft's DevLabs back in April of 2012. Since then we have had several releases and have seen library quickly evolve. As we added new features and received feedback from customers, it was evident that two separate entities were beginning to form. As a result, the "Casablanca" project on DevLabs has been separated into 2 different SDKs: the C++ REST SDK and the Azure SDK for C++.

The first of the two SDKs being released is the C++ REST SDK. It includes tools to quickly write modern, asynchronous C++ code that connects with REST services. We take advantage of the power and productivity offered in C++11 while providing a cross-platform solution. We currently support Windows 7, Windows 8 (Windows store and desktop applications), and Linux.

The main features in this SDK include:

  • Ability to create a connection to a server via a HTTP Client, send requests and handle response.
  • Support for construction and use of Uniform Resource Identifiers (URI).
  • Constructing, parsing and serializing JSON values.
  • Asynchronously reading/writing bytes to/from an underlying medium via Streams and Stream Buffers.

Continue reading...

last.fm releases moost -- a Boost-like library for music

Another step forward in C++ community libraries, joining others including Facebook's and Microsoft's OSS C++ work. This from last.fm last week:

All our tools are belong to you (last.fm)

by Marcus Holland-Moritz

Today we’re releasing moost, a C++ library with all the nice little tools and utilities our MIR team has developed over the past five years. If you’re a C++ developer yourself, you might notice that moost sounds quite similar to boost, and that’s on purpose. moost is the MIR team’s boost, there is hardly a project in our codebase that doesn’t depend on one or more parts of moost.

There are a lot of different things in moost...

Continue reading...