New Adventures in C++ with Cinder and More -- Ale Contenti

The Cinder C++ library for graphics got a shout-out from Herb Sutter at GoingNative'13, and now we get a full hour-long talk about Cinder from Visual Studio's own Ale Contenti.

New Adventures in C++ with Cinder and More

Play and be productive with modern C++, graphics, on-the-fly projects and more! Starting from the latest Going Native 2013 talks as an inspiration, we will explore how easy is to mold ideas into graphics apps with C++ and Cinder, and how simple tools and techniques can help us be more productive in Visual Studio!

Watch the video, or download the slides.

ODB C++ ORM 2.3.0 Released, Adds Schema Evolution Support

ODB is an open source object-relational mapping (ORM) system for C++. It allows you to persist C++ objects to a relational database without having to deal with tables, columns, or SQL and without manually writing any of the mapping code.

Major new features in this release:

  • Support for database schema evolution, including automatic schema migration, immediate and gradual data migration, as well as soft object model changes (ability to work with multiple schema versions using the same C++ classes). For a quick showcase of this functionality see the Changing Persistent Classes section in the Hello World Example chapter.
  • Support for object sections which provide the ability to split data members of a persistent C++ class into independently loaded/updated groups.
  • Support for automatic mapping of C++11 enum classes.

A more detailed discussion of these features can be found on the blog. For the complete list of new features in this version see the official release announcement.

ODB is written in portable C++ (both C++98/03 and C++11 are supported) and you should be able to use it with any modern C++ compiler. In particular, we have tested this release on GNU/Linux (x86/x86-64/ARM), Windows (x86/x86-64), Mac OS X (x86), and Solaris (x86/x86-64/SPARC) with GNU g++ 4.2.x-4.8.x, MS Visual C++ 2005, 2008, 2010, and 2012, Sun Studio 12u2, and Clang 3.x.

The currently supported database systems are MySQL, SQLite, PostgreSQL, Oracle, and SQL Server. ODB also provides optional profiles for Boost and Qt, which allow you to seamlessly use value types, containers, and smart pointers from these libraries in your persistent classes.

More information, documentation, source code, and pre-compiled binaries are available on the project's page.

Interview: Bjarne Stroustrup Discusses C++ -- William Wong

William Wong recently interviewed Bjarne Stroustrup for Electronic Design.

Interview: Bjarne Stroustrup Discusses C++

by William Wong

Much of the content will be familiar to those who've seen or read other recent interviews, but it's a nice concise summary of the essence of C++ including examples in code. If someone you know wonders why C++ was created, or what is the essence of its purpose as a language, or how modern C++ code looks and feels, this article is a good place to send them.

Why does std::condition_variable take a std::unique_lock instead of a std::mutex? -- StackOverflow

Recently on StackOverflow, someone asked: What's the job of std::unique_lock when used with std::condition_variable::wait()?

A more detailed answer is available in this earlier question, including why taking a unique_lock makes the C++ version superior to some other libraries' designs:

C++11: Why does std::condition_variable use std::unique_lock?

I am a bit confused about the role of std::unique_lock when working with std::condition_variable. As far as I understood the documentation, std::unique_lock is basically a bloated lock guard, with the possibility to swap the state between two locks.

I've so far used pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) for this purpose (I guess that's what the STL uses on posix). It takes a mutex, not a lock.

What's the difference here? Is the fact that std::condition_variable deals with std::unique_lock an optimization? If so, how exactly is it faster?

 

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.

N3824: make_array -- Zhihao Yuan

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3824

Date: 2013-10-22

make_array

by Zhihao Yuan

Excerpt:

We have make_tuple, make_pair, but not make_array, while std::array creation can also benefit from this “semiofficial” tuple-like interface to deduce both element type and array bound.

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.