News

Address and Thread Sanitizers in GCC -- Red Hat Developer Blog

A short article about two error-detection features in GCC:

Address and Thread Sanitizers in GCC

by Dodji Seketeli on Red Hat Developer Blog

From the article:

Since their 4.8 version, the C and C++ compilers of the GNU Compiler Collection are equipped with built-in memory and data race errors detectors named Address Sanitizer and Thread Sanitizer.

This article intends to quickly walk you through the highlights of these two interesting tools.

Quick Q: What is noexcept useful for? -- StackOverflow

Quick A: Guaranteeing "this function won't throw" enables optimization opportunities.

Recently on SO:

What is noexcept useful for?

I saw that c++11 added the noexcept keyword. But I don't really understand why is it useful.

If the function throws when it's not supposed to throw - why would I want the program to crash?

So when should I use it?

Also, how will it work along with compiling with /Eha and using _set_se_translator? This means that any line of code can throw c++ exception - because it might throw a SEH exception (Because of accessing protected memory) and it will be translated to c++ exception.

What will happen then?

A gotcha with ptr_vector -- Andrzej Krzemieński

Do you know Boost.Pointer Container? Andrzej gives some useful information in his recent blog entry:

A gotcha with ptr_vector

He gives answers to these questions:

What would you use boost::ptr_vector for? Why would you need to have a vector of pointers, which you want to delete yourself? Is it because:

  1. You want the objects to remain at the same address even if you re-allocate the array under the vector?
  2. You want to inter-operate with a library that already deals with owing pointers?
  3. You want it to be faster than if you were storing values in std::vector?
  4. You want the “polymorphic behavior” of your objects?

Property Testing in C++ -- Jeremy Wright

In case you missed it, this may be midly controversial but we felt it could be of interest:

Property Testing in C++

by Jeremy Wright

From the article:

One might say tests are shiny. I don't know if they are really shiny as much as I found another cool use for uniform_int_distribution<>...

Qt 5.4 released --Lars Knoll

A new major version of the Qt has been released.

Qt 5.4 released

From the news article:

I am happy to announce that Qt 5.4 has been released today and is available for download from qt.io. Together with Qt 5.4, we have also released Qt Creator 3.3 and an update to Qt for device creation on embedded Linux and embedded Android.

But let’s start with Qt 5.4. One of the main focus areas of this Qt release has been around Web technologies and we have a lot of cool new things to offer there...

Why Students Need the CppCat Code Analyzer -- Andrey Karpov

Today on viva64:

Why Students Need the CppCat Code Analyzer

by Andrey Karpov

CppCat is a simple static code analyzer capable of detecting bugs in C/C++ programs. We started granting free academic licenses to all interested (students, teachers, and so on). For the sake of popularizing CppCat among students, I decided to write this post about errors that can be found in student lab work tasks posted at Pastebin.com...

Blaze 2.2 released

Blaze, an open-source, high-performance C++ math library for dense and sparse arithmetic, released their new version.

Blaze 2.2 Released

After a total of five and a half months, a little late for SC'14, but right on time for Meeting C++, we finally release Blaze 2.2! But the waiting time was worthwhile! This release comes with several bug fixes and hundreds of improvements, many based on your hints, suggestions and ideas. Thank you very much for your support and help to make the Blaze library even better!

The big new feature of Blaze 2.2 is symmetric matrices. And this is not just any implementation of symmetric matrices, but one of the most complete and powerful implementations available. See the Blaze tutorial to get an idea of how symmetric matrices work and how they can help you prevent some inadvertent pessimizations of your code.

 

C++ Template Metaprogramming Introduction -- Nicolás Brailovsky

tmp-pandora.PNGIn case you missed it, from Nicolás Brailovsky's blog -- an interesting post after you get past a little ranting:

C++ Template Metaprogramming Introduction

by Nicolás Brailovsky

From the article:

First, we need to start with a little clarification: using template <class T> to parametrize a class, something like std::vector does, is not template metaprogramming. That’s just a generic class (Java-pun intended). That is indeed a useful case for templates, but it has little fun in it.

Template metaprogramming is much more fun than mere generic classes...

A few notes:

  • Even if template metaprogramming isn't something that every C++ developer will do on daily basis, it's worth being able to understand when you see it.
  • For homework, try solving the Hanoi Tower problem by using template metaprogramming. [A sample for the 8-Queens problem is available here.]