advanced

CppCon 2015 completion T : Improving the future T with monads--Travis Gockel

Have you registered for CppCon 2016 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

completion T : Improving the future T with monads

by Travis Gockel

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

std::future provides us a mechanism for asynchronous communication between a provider and receiver. However, the C++14 standard does not allow for actual asynchronous programming, as the only ways to interact with an std::future are blocking calls. The proposed then helps, but the interface is awkward and can be extremely slow when handling exceptions. Here, I will talk about completion a high-performance, async-only and monadic alternative to std::future and how it is used at SolidFire.

CppCon 2015 Executors for C++ - A Long Story ...--Detlef Vollmann

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

Executors for C++ - A Long Story ...

by Detlef Vollmann

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Executors will be a base building block in C++ for asynchronous, concurrent and parallel work. The job of an executor is simple: run the tasks that are posted. So the first proposals for executors in C++ had a very simple interface. However, being a building block, the executor should provide an interface that's useful for all kind of higher level abstractions and needs to work together with different types of concurrency, like co-operative multi-tasking or GPU like hardware. This presentation will look at the evolution of the executor proposals for C++ and what they'll provide for normal application programmers.

Talks at Meeting C++ 2016

Most talks of this years Meeting C++ conference are now online:

Talks at Meeting C++ 2016

by Jens Weller

The top 7 Talks chosen by the voting:

Exploring C++17 and beyond
C++ Static Analysis
Functional reactive programming in C++
C++ Core Guidelines: Migrating your Code Base
Want fast C++? Know your hardware!
The memory model in C++
Implementing `static` control flow in C++14

CppCon 2015 C++ for cross-platform VR--Nicolas Lazareff

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

C++ for cross-platform VR

by Nicolas Lazareff

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

This talk is an overview of how C++ can be used to quickly create cross-platform virtual reality experiences while sharing one codebase.

To support all major vendors, a VR experience has to span not only across operating systems, but also device types, hardware specs, manufacturers, and SDKs -- and so pitfalls and learnings from shipping on Oculus mobile and desktop, Google Cardboard, and soon Sony's Morpheus will be discussed.

We'll cover networking, graphics, SDK wrappers, and even abstracting language oddities (Android's Java layer for Oculus mobile).

CppCon 2015 Live Lock-Free or Deadlock (Practical Lock-free Programming)--Fedor Pikus

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

Live Lock-Free or Deadlock (Practical Lock-free Programming)

by Fedor Pikus

Part 1: (watch on YouTube) (watch on Channel 9)

Part 2: (watch on YouTube) (watch on Channel 9)

Summary of the talk:

Part I:

Introduction to lock-free programming. We will cover the fundamentals of lock-free vs lock-based programming, explore the reasons to write lock-free programs as well as the reasons not to. We will learn, or be reminded, of the basic tools of lock-free programming and consider few simple examples. To make sure you stay on for part II, we will try something beyond the simple examples, for example, a lock-free list, just to see how insanely complex the problems can get.

Part II:

having been burned on the complexities of generic lock-free algorithms in part I, we take a more practical approach: assuming we are not all writing STL, what limitations can we really live with? Turns out that there are some inherent limitations imposed by the nature of the concurrent problem: is here really such a thing as “concurrent queue” (yes, sort of) and we can take advantages of these limitations (what an idea, concurrency actually makes something easier!) Then there are practical limitations that most application programmers can accept: is there really such a thing as a “lock-free queue” (may be, and you don’t need it). We will explore practical examples of (mostly) lock-free data structures, with actual implementations and performance measurements. Even if the specific limitations and simplifying assumptions used in this talk do not apply to your problem, the main idea to take away is how to find such assumptions and take advantage of them, because, chances are, you can use lock-free techniques and write code that works for you and is much simpler than what you learned before.

 

CppCon 2015 C++ in the Audio Industry--Timur Doumler

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

C++ in the Audio Industry

by Timur Doumler

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Sound is an essential medium for human-computer interaction and vital for applications such as games and music production software. In the audio industry, C++ is the dominating programming language. This talk provides an insight into the patterns and tools that C++ developers in the audio industry rely on. There are interesting lessons to be learned from this domain that can be useful to every C++ developer.

Handling audio in real time presents interesting technical challenges. Techniques also used in other C++ domains have to be combined: real-time multithreading, lock-free programming, efficient DSP, SIMD, and low-latency hardware communication. C++ is the language of choice to tie all these requirements together. Clever leveraging of advanced C++ techniques, template metaprogramming, and the new C++11/14 standard makes these tasks more exciting than ever.

CppCon 2015 Variadic Templates in C++11 / C++14 - An Introduction--Peter Sommerlad

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

Variadic Templates in C++11 / C++14 - An Introduction

by Peter Sommerlad

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Writing class templates and functions accepting a variable number of arguments has been a burden before C++11. With variadic templates, both class templates with a variable number of arguments as well as functions can be formulated much easier and more type safe way.

Nevertheless, the authoring of variadic templates can be challenging for the uninitiated. Even the interpretation of variadic template code can be a problem, as Olve Maudal's famous pub quiz shows.

This session will build up understanding and the ability to use and author variadic template functions and variadic template classes from easy examples up to more complicated applications such as employing std::forward correctly, std::integer_sequence and other upcoming language features such as a template UDL operator that bridges the gap between string literals and std::integer_sequence.

Understanding pack expansion, sizeof... and other hard to get on first sight issues are my goal. In the end you should have seen guidelines that help you avoid the template instantiation trap from the pub quiz and correct usage of std::forward in your variadic templates.

Quick Q: If nullptr_t isn't a keyword, why are char16_t and char32_t?

Quick A: To allow overloading with the underlying types of uint_least16_t and uint_least32_t

Recently on SO:

If nullptr_t isn't a keyword, why are char16_t and char32_t?

The proposal itself explains why: to allow overloading with the underlying types of uint_least16_t and uint_least32_t. If they were typedefed this wouldn't be possible.

Define char16_t to be a distinct new type, that has the same size and representation as uint_least16_t. Likewise, define char32_t to be a distinct new type, that has the same size and representation as uint_least32_t.

[N1040 defined char16_t and char32_t as typedefs to uint_least16_t and uint_least32_t, which make overloading on these characters impossible.]

As for why they aren't in the std namespace, this is for compatibility with the original C proposal. C++ prohibits the C definitions from appearing in its own version of <cuchar>

[c.strings] / 3

The headers shall not define the types char16_t, char32_t, and wchar_t (2.11).
The types then would need to be global typedefs, which carries its own set of issues such as
typedef decltype(u'q') char16_t;

namespace foo {
  typedef int char16_t;
}

The reason for std::nullptr_t not being a keyword can be found in the question you linked

We do not expect to see much direct use of nullptr_t in real programs.
making nullptr_t the real exception here.

 

CppCon 2015 Beyond Sanitizers...--Kostya Serebryany

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:

Beyond Sanitizers...

by Kostya Serebryany

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

At CppCon’2014 we presented the Sanitizers, a family of dynamic testing tools for C++. These tools allow you to find many stability and security bugs in C++ code, but they are only as good as your tests are. In this talk we will show how to improve your tests with guided fuzzing and how to protect your applications in production even if some bugs were not found. Fuzzing, or fuzz testing, is a surprisingly effective technique that allows you to discover new interesting test inputs. Coverage-guided fuzzing uses coverage-like code instrumentation to make fuzzing orders of magnitude more efficient. Taint-guided fuzzing goes even further by using taint tracking techniques. The next line of defense may be incorporated directly into production: the Control Flow Integrity instrumentation allows you to protect your program from corrupted function pointers (including pointers to virtual tables) and separating stack variables from the call stack protects from corrupted return addresses -- both with near-zero overhead. We will concentrate on particular tools implemented in the opensource LLVM toolchain (libFuzzer, DataFlowSanitizer, -fsanitize=cfi,safe_stack), but will also discuss several alternatives.