May 2014

Qt 5.3 released

 

Qt 5.3 is now available.

Qt is the most widely-known and -used portable UI framework for C++. It offers native code performance and modern sophisticated user experiences across desktop, embedded, and mobile platforms. Both commercial and open source versions are available.

More details from the Qt 5.3 product page:

With Qt 5.3 a lot of effort was put into enhancing the overall quality and user experience across all the platforms. Qt 5.2 introduced a completely new dimension into cross-platform: the mobile platforms and it has been downloaded an amazing amount of more than 1 million times!

...

  • Added Qt Positioning API support for Android and iOS. Use the GPS directly from convenient Qt APIs!
  • Qt Bluetooth API has now support for Android as well
  • Printing support for Qt has been greatly enhanced
  • Qt 5.3 ships with Qt Creator 3.1, which also introduced a lot of enhancements and stability to existing features as well as an initial support for WinRT tooling, a new clang-based code model and improved Android tool chain integration.

CppCon: My Proposed Talks (Part 2) -- Herb Sutter

cppcon-108.PNGFollowing up on Herb's three talk proposals posted yesterday, the other two titles and abstracts are now posted, this time of new talks (note: again, pending review and selection by the program committee, so this is not final -- they may or may not be selected if there is stronger material).

CppCon: My Proposed Talks (Part 2)

by Herb Sutter

From the post:

GC for C++, and C++ for GC: “Right” and “Wrong” Ways to Add Garbage Collection to C++ (1 to 2 hours)

"Garbage collection is essential to modern programming!" "Garbage collection is silly, who needs it!"

As is usual with extremes, both of these statements are wrong. Garbage collection (GC) is not needed for most C++ programs; we're very happy with determinism and smart pointers, and GC is absolutely penalizing when overused, especially as a default (or, shudder, only) memory allocator. However, the truth is that GC is also important to certain high-performance and highly-concurrent data structures, because it helps solve advanced lock-free problems like the ABA problem better than workarounds like hazard pointers.

This talk presents thoughts about how GC can be added well to C++, directly complementing (not competing with) C++'s existing strengths and demonstrating why, as Stroustrup says, "C++ is the best language for garbage collection."

 

Addressing C++’s #1 Problem: Defining a C++ ABI (1 hour)

"Why can't I share C++ libraries even between my own internal teams without using the identical compiler and switch settings?" "Why are operating system APIs written in unsafe C, instead of C++?" "Why can’t I use std::string in a public shared library interface; it's the C++ string, isn't it?!"

These and more perennial questions are caused by the same underlying problem: For various historical reasons, C++ does not have a standard binary interface, or ABI. Partial solutions exist, from the Itanium ABI which addresses only the language and only on some platforms, to COM and CORBA which do both less and far more than is needed.

It is deeply ironic that there actually is a way to write an API in C++ so that it has a de facto stable binary ABI on every platform: extern "C".

This session describes current work driven by the presenter to develop a standard C++ ABI. This does not mean having identical binaries on all platforms. It does mean tackling all of the above problems, including directly addressing the #1 valid reason to use C instead of C++, and removing a major obstacle to sharing binary C++ libraries in a modern way.

libstudxml: A modern XML API for C++

libstudxml.PNGlibstudxml is an XML library for modern, standard C++. It has an API that I believe should have already been in Boost or even in the C++ standard library.

The API was first presented at the C++Now 2014 conference. Based on the positive feedback and encouragement I received during the talk, I've decided to make the implementation generally available.

As an example, we can parse this XML:

<person id="123">
  <name>John Doe</name>
  <age>23</age>
  <gender>male</gender>
</person>

With the following C++ code, which performs all the validation necessary for this XML vocabulary:

enum class gender {...};

ifstream ifs (argv[1]);
parser p (ifs, argv[1]);

p.next_expect (parser::start_element, "person", content::complex);

long id = p.attribute<long> ("id");

string n = p.element ("name");
short a = p.element<short> ("age");
gender g = p.element<gender> ("gender");

p.next_expect (parser::end_element); // person

The API has the following interesting features:

  • Streaming pull parser and streaming serializer
  • Two-level API: minimum overhead low-level & more convenient high-level
  • Content model-aware (empty, simple, complex, mixed)
  • Whitespace processing based on content model
  • Validation based on content model
  • Validation of missing/extra attributes
  • Validation of unexpected events (elements, etc)
  • Data extraction to value types
  • Attribute map with extended lifetime (high-level API)

libstudxml is compact, external dependency-free, and reasonably efficient. The XML parser is a conforming, non-validating XML 1.0 implementation that is based on tested and proven code. The library is released under the MIT license.

More information, documentation, and source code are available from libstudxml project page. Or, you can jump directly to the API description with examples.

N4000: Standard Wording for a Transaction-safe C++ Standard Library std::list -- Michael Wong et al.

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: N4000

Date: 2014-05-23

Standard wording for a Transaction-safe C++ Standard Library std::list

by Michael Wong, et al.

Excerpt:

This paper documents our effort to transactionalize a C++ Standard Template Library (STL) container to demonstrate the feasibility of the transactional language constructs proposed by Study Group 5 (SG5): Transactional Memory. We began this study with std::list and made it transaction-safe using the transactional memory support in GCC 4.9. ...

Changes from previous versions

N4000 (this paper): present updates and summary from LEWG and propose wording for TM TS for LWG

N3990: Adding standard circular shift operators for computer integers -- D Gutson, A Bustamente

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: N3990

Date: 2014-05-08

Adding standard circular shift operators for computer integers

by Daniel Gutson, Angel Bustamente

Excerpt:

C and C++ languages have the standard set of bitwise operations, including OR, AND, XOR, LEFT/RIGHT SHIFT, NOT. However, circular shift (left and right rotate) isn't included in the language.

N3987: Yet another set of C++ type traits -- Cleiton Santoia Silva and Daniel Auresco

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: N3987

Date: 2014-05-07

Yet another set of C++ type traits

by Cleiton Santoia Silva and Daniel Auresco

Excerpt:

Just as exercise you can pick all keywords of C++ and put a is_ before and thought if it make sense.

N3986: Adding Standard support to avoid padding within structures -- Davalle, Gutson, Bustamente

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: N3986

Date: 2014-04-25

Adding Standard support to avoid padding within structures

by Sebastian Davalle, Daniel Gutson, Angel Bustamante

Excerpt:

Sometimes programmers might need to avoid the bitfields’ alignment to get a compact type. Although this behavior can be obtained in most compilers by specifying the "packed" attribute, a more standard and simpler way to force it should exist (similar to the :0 syntax).

N3985: A proposal to add coroutines... (Revision 1) -- Oliver Kowalke and Nat Goodspeed

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: N3985

Date: 2014-05-06

A proposal to add coroutines to the C++ standard library (Revision 1)

by Oliver Kowalke and Nat Goodspeed

Excerpt:

Changes in this revision

This document supersedes N3708. A new kind of coroutines -- std::symmetric_coroutine<T>
-- is introduced and additional examples (like recursive SAX parsing) are added.

A section explains the benfits of using coroutines in the context of event-based asynchronous model.

 

N3984: Adding attribute reflection to C++ -- Cleiton Santoia Silva and Daniel Auresco

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: N3984

Date: 2014-05-07

Adding attribute reflection to C++

by Cleiton Santoia Silva and Daniel Auresco

Excerpt:

C++ reflection mechanism could benefit from a more complete set of functionality, if we define how to
reflect attributes as well as types.

N3983: Hashing tuple-like types -- Geoffrey Romer

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: N3983

Date: 2014-05-07

Hashing tuple-like types

by Geoffrey Romer

Excerpt:

This paper proposes to add std::hash specializations for the “tuplelike” types in the standard library, namely std::pair, std::tuple, and std::array.