November 2013

N3805: Spring 2014 JTC1/SC22/WG21 C++ Standardization Committee Meeting—Peter Sommerlad

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

Date: 2013-11-28

Spring 2014 JTC1/SC22/WG21 C++ Standardization Committee Meeting

by Peter Sommerlad


C++ Standardization Committee Meeting

June 16th-21st 2014

The meeting will be held at the University of Applied Sciences, HSR Rapperswil, Switzerland

HSR Rapperswil and IFS Institute for Software invite you to the C++ Standards Committee Meeting at the picturesque shore of Lake Zurich...

Tips for founding new (C++) user groups—Jens Weller

We're seeing quite a few new C++ user groups being formed, and so it's a good time to link to this timely article by Jens Weller:

Founding local C++ User Groups

From the article:

Lets start into the discussion on founding user groups, there is in my opinion different approaches to get started, but I don't want this to be a discussion, so I'll just list what I think is right. First I think that a C++ User Group should be local, which means its usually for a certain region. From my expierence, people are willing to travel up to 70km one way to a user group meeting. So in order to get started, I think you'll need the following four points:

  • People
  • Location
  • Topics
  • Date


Quick Q: When do you need to declare a variable constexpr?—StackOverflow

Quick A: When you want to use the variable in a way that requires its value to be known at compile time.

Here's a short nugget that helps demonstrate the meaning of constexpr:

Why is constexpr required even though member function is constexpr?

The following does not compile unless I put constexpr before initializer_list:

constexpr std::initializer_list<int> il = {
    1, 2, 3, 4, 5, 6, 7, 8, 9, 10
std::array<int, il.size()> a;

But initializer_list size is constexpr:

constexpr size_type size() const;

What are inline namespaces good for?—StackOverflow

Quick A: For source-level library versioning.

A StackOverflow classic:

What are inline namespaces for?

C++11 allows inline namespaces, all members of which are also automatically in the enclosing namespace. I cannot think of any useful application of this -- can somebody please give a brief, succinct example of a situation where an inline namespace is needed and where it is the most idiomatic solution?

(Also, it is not clear to me what happens when a namespace is declared inline in one but not all declarations, which may live in different files. Isn't this begging for trouble?)

Quick Q: Why write “5 == myValue” instead of “myvalue == 5”?—StackOverflow

Quick A: Because it catches most cases where you accidentally wrote = instead of ==.

From SO:

Reason for using '5 == myValue' in conditionals

I've come across some code that flips how a condition is checked and was wondering why this would be done aside from a weird personal quirk. I've never seen any text books use it nor have I seen any sample code done this way.

// why do it this way?
if (5 == myValue)
    // do something

// instead of:
if (myValue == 5)
    // do something

I've only seen this way for == operand but not for any other operands.

Deleted Functions in C++11—Fang Lu

Here is a quick overview of =delete from the IBM Cafe's tour of C++ features.

Note: This summary article focuses on applying =delete to special member functions, which is a main use case. However, be aware that that's only part of the story, because =delete can also apply to regular member function and free function overloads to suppress specific overloads with nice compile-time errors. We invite authors to write about this aspect as well -- just write about it on your own blog and and send us a link to your post via 'Suggest an Article' at the top of this page (you must be logged in to to see this option).

Deleted functions in C++11

by Fang Lu

The deleted functions feature is introduced into the C++11 standard. In this article, I will explain this feature and provide some examples on how to use it...

C++ AMP beyond Windows: Targeting HSAIL and SPIR on Linux and other platforms

The HSA Foundation together with AMD and Microsoft recently announced an open source C++ AMP compiler implementation they have been working on, using the Clang/LLVM C++ compiler as a base but currently separate from Clang/LLVM. The implementation targets OpenCL, HSAIL, and SPIR 1.2 on Linux and other non-Windows platforms. When the work is finished, the intention is to approach the LLVM community to offer this work as a contribution back to the official Clang/LLVM code base if there is interest.

C++ AMP is an open specification from Microsoft that enables STL-like C++ extensions for massively parallel computation using GPUs and vector units, and is part of the basis for the Parallel STL proposal now under consideration for standardized parallel computations on multicore and vector hardware.

AMD released on Nov 12, 2013 a fully open sourced C++ AMP compiler based on  CLANG/LLVM with outputs to OpenCL and Khronos Group SPIR 1.2 initially. This compiler will have HSAIL support in early 2014 for HSA platforms.   This initial focus is bring about Linux support for C++AMP, complete with GPU acceleration.  AMD is also bringing their BOLT Standard Template library over to be qualified with this tool chain.

Microsoft is engaged with AMD and MultiCoreWare, by providing design and validation inputs to help drive the success of this project.


Bringing C++ AMP Beyond Windows via CLANG and LLVM