April 2013

Advanced Developer Conference C++

adc.PNGThere's still time to go to:

Advanced Developers C++ 2013

May 7-8, 2013

Bad Aibling, Germany

Sessions are presented in either English or German. While the conference has many Windows-focused topics, a number of the sessions are of general interest to C++ developers.

Here are highlights from the Sessions page:

Trends and Future of C++ Standard and ISOCPP.org
Transactional Memory in C++
Michael Wong, IBM, and subgroup chair of ISO C++ SG5 (Transactional Memory)

Keynote: Building Modern Device Apps with C++ 
Building and Consuming Cloud Services with C++
Steve Teixeira, Microsoft

Warum wird Code so wie er ist? [Why does code get the way it does?]
Holger Kolb, DEVCOL

Einfacheres C++ mit C++11 [Simpler C++ with C++11]
Peter Sommerlad, FHO HSR Hochschule für Technik

Sicher sein oder sicher fühlen? -- Sicheren C++ Code schreiben [Be secure or feel secure? -- Writing secure C++ code]
Oliver Niehus, Microsoft

Performance-Optimierung für parallelen C++ Code auf Windows [Performance optimizing parallel C++ code on Windows]
Programmieren und Optimieren auf Xeon Phi [Programming and Optimizing for Xeon Phi]
Michael Steyer, Intel

Continue reading more sessions...

Trip Report: ISO C++ Spring 2013 Meeting, Part 3 -- Michael Wong

iconNoCommunityPhoto155.pngPart 3 of Michael Wong's trip report:

The view from C++ Standard meeting April 2013 Part 3

by Michael Wong

In this series that looks at C++14 content, we looked at features from Language and Library for C++14. Now we will look at Concurrency which is the other group that contributed features for C++14. In reality, some of the features from Language and Library also came from Concurrency. ...

An Idiot's Guide to C++ Templates -- Ajay Vijayvargiya

A lot of people appreciated the information in this pair of articles, which cover the noted topics:

An Idiot's Guide to C++ Templates -- Part 1

The Syntax Drama

Function Templates

  • Pointers, References and Arrays with Templates
  • Multiple Types with Function Templates
  • Function Template -- Template Function
  • Explicit Template Argument Specification
  • Default Arguments with Function Templates

Class Templates

  • Multiple Types with Class Templates
  • Non-type Template Arguments
  • Template Class as Argument to Class Template
  • Default Template Arguments with Class Templates
  • Class' Methods as Function Templates

An Idiot's Guide to C++ Templates -- Part 2

Requirements from the Underlying Type

  • Requirements: Function Templates
  • Requirements: Class Templates

Separation of Declaration and Implementation

  • Separating Class Implementation

Templates and Other Aspects of C++

  • Class Templates, Friends
  • Class Templates, Operator Overloading
  • Class Templates, Inheritance
  • Function Pointers and Callbacks
  • Templates and Virtual Functions
  • Templates and Macros
  • Function Overloading

STL - An Introduction

Templates and Library Development

Explicit Instantiation

C++ on the Web: Run Your Big 3D Game in the Browser! -- Andre Weissflog

cpp-web.PNGBuilding C++ to target Javascript (e.g., asm.js) and execute C++ in the browser is becoming quite the popular indoor sport. Here's a current presentation and experience report:

C++ on the Web: Run your big 3D Game in the browser! (slides)

by Andre Weissflog
Head of Development, Berlin
Bigpoint GmbH

My presentation about porting large C/C++ code bases to the browser (emscripten, flascc, Google Native Client)

From the Wrap-up slide:

  • You can run big C/C++ code bases ("a million lines of code") in the browser.
  • Javascript is already fast enough for many types of games.
  • Massive performance improvements happening right now (better code generation, JS engines better at running generated code, asm.js...)
  • ...

Trip Report: ISO C++ Spring 2013 Meeting, Part 2 -- Michael Wong

iconNoCommunityPhoto155.pngPart 2 of Michael Wong's trip report:

The view from C++ Standard meeting April 2013 Part 2

by Michael Wong

In part 1 of this trip report, I spoke about the general mood of the April C++ Std meeting in Bristol and the plan to release C++14 [Committee] Draft (CD) after the meeting. I also deep dived into the language feature set for C++14.

Now I will deep dive onto the library feature additions for C++14. As with the language features, some of these originated from other subgroups. As before, I will not talk about minor bug fixes, but also talk about proposals that did not pass as they are often the most controversial. ...

Trip Report: ISO C++ Spring 2013 Meeting -- Michael Wong

iconNoCommunityPhoto155.pngA trip report from Michael Wong:

The view from C++ Standard meeting April 2013 Part 1

by Michael Wong

... Our goal was to triage all features that can enter C++14. This means C++14 is more than just bug fixes and is unlike a Technical Corrigendum like TC1 which bridged C++ 1998 to C++2003. As such it will have additional features beyond defect fixes that has been deemed to be small enough in scope and solution but significant enough in annoyance that it should be fixed immediately post C++11...

Here are the new language extensions voted in...

Quick Q: When should I use noexcept? -- StackOverflow

As C++11-compliant compilers start to roll out and be adopted, people want to know to best use new C++11 features, such as:

When Should I Really Use noexcept?

 

  1. There are many examples of functions that I know will never throw, but for which the compiler cannot determine so on its own. Should I append noexcept to the function declaration in all such cases? ... For which situations should I be more careful about the use of noexcept, and for which situations can I get away with the implied noexcept(false)?
  2. When can I realistically except to observe a performance improvement after using noexcept... Do modern compilers take advantage of noexcept in this way? If not, can I excect some of them to do so in the near future?

 

Thanks to our Bristol hosts!

I would like to personally thank (again) our hosts for last week's ISO C++ standards meeting in Bristol, notably Roger Orr and our U.K. national body host BSI, as well as the sponsors who supported the meeting financially and otherwise: ACCU, Google, Archer-Yates, Getco, Red Hat, and Gnu C++ User.

  

Our hosts and sponsors not only provided great facilities, but demonstrated grace under pressure when the registered attendee count rose beyond expectations weeks before the meeting, and then continued to rise, ending up far above recent attendance records. Our hosts rose to the occasion, providing meeting space for more national body experts and more subgroups meeting in parallel than we've seen for some 15 years. And they generously fed everyone lunch each day for six days, going well above and beyond expectations. (The hosts for the Chicago meeting this fall have taken notice and are preparing accordingly, and we appreciate their generosity as well.)

Aside: My trip report graph shows that there were 100 experts attending last week, but that's conservative. We had 102 pre-registered to attend, and it looks like the final count will be 107 at the meeting; I'm waiting for the confirmed number and will update that trip report when I get it. For comparison, up till 2011 the average meeting attendance was half that.

Thanks again, Roger and BSI and all of our meeting sponsors! It was a well-hosted, smoothly run, and very productive meeting. Thank you.

Preconditions, Part 4 -- Andrzej KrzemieĊ„ski

Here is Andrzej's final (for now) post on preconditions, posted just 

Preconditions — Part IV

by Andrzej Krzemieński

This is the last post about preconditions. We will try to address concerns about a potential UB connected with expressing preconditions. We will also try to explore how language support for preconditions could look like.

 

...

Such a support for preconditions would be a very helpful feature. But let’s not fantasize too much. For now the best thing we can do is to use assertions and comments -- a very useful and often underestimated language feature.

New adopted paper: N3659, Shared Locking in C++ -- Howard Hinnant, Detlef Vollmann, Hans Boehm

Note: This paper was adopted into draft C++14 on Saturday at the Bristol UK ISO C++ meeting.

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

Date: 2013-04-19

Shared locking in C++ (a.k.a. reader/writer locks)

by Howard Hinnant, Detlef Vollmann, Hans Boehm

Excerpt:

N3568 was presented at the Spring 2013 meeting in Bristol to SG1 (Concurrency and Parallelism). The decision was to bring shared_mutex only forward for C++14. Also the specification should allow for spurious failures.

 

From N3568:

This proposal adds functionality to allow clients to easily code the well-known multiple-readers / single-writer locking pattern. ...

... a shared_mutex can be locked in one of two ownership modes:

  1. Exclusive, using lock(), or
  2. Shared, using lock_shared().

... The recommended pattern for locking a shared_mutex in shared ownership mode is not to call m.lock_shared() directly, but to use shared_lock<shared_mutex>:

shared_mutex mut;
...
void foo()
{
     shared_lock<shared_mutex> _(mut);
     // mut lock_shared'd here
     // ...
}    // mut.unlock_shared() called here