News

Trip report: Fall ISO C++ meeting -- Michael Wong

Michael Wong, head of Canadian delegation, has posted Part 1 of his report on the September ISO C++ meeting held in Chicago.

The View from the C++ Standard meeting September 2013 Part 1

by Michael Wong

From the article:

At this meeting, the most important thing was to address as many of the National Body (NB) Comments from the draft C++14 CD possible. This will enable us to be in good shape for the release of C++14 in 2014. Please look at my blog series to get an idea of the major content. However, this meeting did have some interesting minor changes which modified that content. This is fairly normal to decouple features which is still controversial. The biggest change is the moving of VLA (or what we called Array of Runtime Bound) and dynarray into a library array TS, and the adoption of the single quote as a digit separator for C++14.

This week in C++: EDG 4.8 and Visual C++ 2013

The past week saw new releases of two major C++ implementations, with a focus on standards conformance improvements.

Edison Design Group (EDG) shipped version 4.8 of their C++ compiler front-end. This is the first EDG C++ release to achieve full C++11 language conformance. It adds support for C++11 inheriting constructors, user-defined literals, thread_local variables, alignment support (alignof and alignas), and complete decltype support.

Note: You can't buy a complete compiler from EDG, but EDG's front-end is a key part of several major commercial compilers and tools. With the availability of 4.8, this means that EDG-based products such as Intel's ICC compiler could achieve full language conformance when they can integrate the EDG 4.8 front-end in a future release.

Microsoft shipped Visual C++ 2013, a major update to VC++ 2012 with additional C++ conformance features. Since last year's release, VC++ 2013 adds the following ISO C++ features: explicit conversion operators, raw string literals, function template default arguments, delegating constructors, { } uniform initialization syntax and initializer_lists, variadic templates, non-static data member initializers, =default, =delete, and using aliases. This release also include some small post-C++11 features that were approved earlier this year for inclusion in the draft of the upcoming C++14 standard, including make_unique, nonmember cbegin/cend, the improved <functional> operator functors such as greater<>, and the new transformation trait type aliases such as remove_reference_t.

At the GoingNative conference in September, Microsoft also announced that before the end of the year it expects to release a follow-on "alpha" or preview compiler containining initial implementations of additional C++11 language features, likely including 'some or all of' the following: implicit move function generation, & and && qualifiers on member functions, __func__, extended sizeof, thread-safe initialization of function local static variables, unconditional noexcept, constexpr on functions other than constructors, and possibly inheriting constructors. The CTP is also expected to include support for several new draft-standard C++14 language features, including auto function return type deduction, decltype(auto), and possibly the much-anticipated C++14 marquee feature generic lambdas. It will likely also include an initial implementation of the await concurrency language feature that is being proposed for possible inclusion in a future standard.

CGAL 4.3 Released, Computational Geometry Algorithms Library

cgal_front_page_2013.pngThe CGAL Open Source Project is pleased to announce the release 4.3 of CGAL, the Computational Geometry Algorithms Library.

Besides fixes to existing packages, the following has changed since CGAL 4.2:

  • The CGAL Manual generated with Doxygen

    The documentation of CGAL is now generated with Doxygen: http://doc.cgal.org/4.3

    The conversion to Doxygen from our home-made tools was not completely smooth. Please report any documentation bug you may discover to our Inria Forge bug tracker.

  • 2D Periodic Triangulations (new package)

    This package allows to build and handle triangulations of point sets in the two dimensional flat torus. Triangulations are built incrementally and can be modified by insertion or removal of vertices. They offer point location facilities. The package provides Delaunay triangulations and offers nearest neighbor queries and primitives to build the dual Voronoi diagrams.

See http://www.cgal.org/releases.html for a complete list of changes.

The CGAL project is a collaborative effort to develop a robust, easy-to-use, and efficient C++ software library of geometric data structures and algorithms, such as:

  • triangulations (2D constrained triangulations, Delaunay triangulations and periodic triangulations in 2D and 3D),
  • Voronoi diagrams (for 2D and 3D points, 2D additively weighted Voronoi diagrams, and segment Voronoi diagrams),
  • Boolean operations on polygons and polyhedra,
  • regularized Boolean operations on polygons with curved arcs
  • arrangements of curves,
  • mesh generation (2D, 3D and surface mesh generation, surface mesh subdivision and parametrization),
  • alpha shapes (in 2D and 3D),
  • convex hull algorithms (in 2D, 3D and dD),
  • operations on polygons (straight skeleton and offset polygon),
  • search structures (kd trees for nearest neighbor search, and range and segment trees),
  • interpolation (natural neighbor interpolation and placement of streamlines),
  • optimization algorithms (smallest enclosing sphere of points or spheres, smallest enclosing ellipsoid of points, principal component analysis),
  • kinetic data structures.

Some modules are distributed under the terms of the LGPL Open Source license (GNU Lesser General Public License v3 or later versions). Most modules are distributed under the terms of the GPL Open Source license (GNU General Public License v3 or later versions). If your intended usage does not meet the criteria of the aforementioned licenses, a commercial license can be purchased from GeometryFactory.

For further information and for downloading the library and its documentation, please visit the CGAL web site.

C++11 and Boost

What issues arise when combining C++11 and (older) Boost code that has pre-standard versions of C++11 features?

C++11 and Boost

by Jens Weller

From the article:

Some parts of the Standard Library in C++11 are predated in boost. When playing around with C++11, you get used to using some parts in the Standard Library that are used in C++03 with their boost counterpart. Also, there is some libraries now occuring, which are C++11 based, so interfacing with either boost or C++11 code is soon an issue.

No Runtime Overhead -- Bulldozer00

sharedunique.pngA little nugget about the free-as-in-no-overhead-ness of unique_ptr and std::move:

No Runtime Overhead

by Bulldozer00

From the article:

Unless I really need shared ownership of a dynamically allocated object, which I haven’t so far, I stick to the slimmer and more performant std::unique_ptr. ...

Out Parameters, Move Semantics, and Stateful Algorithms -- Eric Niebler

In this article, Eric Niebler discusses an issue of API design regarding the age-old question of out parameters versus return-by-value, this time in light of move semantics. He uses std::getline as his example.

Out Parameters, Move Semantics, and Stateful Algorithms

by Eric Niebler

From the article:

I think getline is a curious example because what looks at first blush like a pure out parameter is, in fact, an in/out parameter; on the way in, getline uses the passed-in buffer’s capacity to make it more efficient. This puts getline into a large class of algorithms that work better when they have a chance to cache or precompute something.

 

Double-Checked Locking Is Fixed in C++11 -- Jeff Preshing

preshing.PNGJeff Preshing gives a nice overview of the on-again/off-again/on-again status of a common approach to lazy initialization.

[Ed: Note that DCLP is not just for thread-safe singletons, that's just a handy example. It's for lazy initialization in general.]

Double-Checked Locking Is Fixed in C++11

by Jeff Preshing

From the article:

The double-checked locking pattern (DCLP) is a bit of a notorious case study in lock-free programming. Up until 2004, there was no safe way to implement it in Java. Before C++11, there was no safe way to implement it in portable C++.

As the pattern gained attention for the shortcomings it exposed in those languages, people began to write about it. In 2000, a group of high-profile Java developers got together and signed a declaration entitled “Double-Checked Locking Is Broken”. In 2004, Scott Meyers and Andrei Alexandrescu published an article entitled “C++ and the Perils of Double-Checked Locking”. Both papers are great primers on what DCLP is, and why, at the time, those languages were inadequate for implementing it.

All of that’s in the past. Java now has a revised memory model, with new semantics for the volatile keyword, which makes it possible to implement DCLP safely. Likewise, C++11 has a shiny new memory model and atomic library which enable a wide variety of portable DCLP implementations. C++11, in turn, inspired Mintomic, a small library I released earlier this year which makes it possible to implement DCLP on some older C/C++ compilers as well.

In this post, I’ll focus on the C++ implementations of DCLP...

New "using std::cpp" event in Spain (Spanish only)

Ready for a full day of C++11/14/17 content in the Spanish language?

using std:cpp

November 26, 2013

University Carlos III of Madrid in Leganés

The site and the event are entirely in Spanish. For convenience, here is an automatic translation of the event page:

Welcome to using std::cpp 2013

using std::cpp 2013 aims to be a forum for exchanging experiences using the C++ language, paying special attention to the recent standard C++11 and the upcoming C++14 and C++17.

Who should attend using std::cpp 2013?

The event is aimed at professional developers using C++ as a language for application development or infrastructure software. It is also aimed at students of last years of career, interested in the use of C++ as a programming language to produce complex computer systems with high performance.

What can I find in using std:cpp 2013?

We have prepared an intensive programme with presentations by leading developers from leading companies in their sectors (Indizen, TCP-SI, BBVA, Telefónica, Digital, INDRA, Biicode, Microsoft, Programming Research Group).

You can refer to the detailed program to see topics you can expect.

When does using std::cpp take place?

using std::cpp 2013 will be held on November 26, 2013 at the School Politécnica Superior of the Universidad Carlos III de Madrid in Leganes and will last for a full day.

Do I need to register?

using std::cpp 2013 attendance is free, but you must register to facilitate the organization of the event. You can register here.