C++Now 2019 has ended

Log in to bookmark your favorites and sync them to your phone or calendar.

case study [clear filter]
Monday, May 6

16:30 MDT

Dependency Injection - a 25-dollar term for a 5-cent concept
Over the years the term - Dependency Injection (DI) - has become more and more mystical while in actual fact DI is as simple as ABC. For those of you who have ever used constructors, you have inadvertently been using DI!

In this practical session, we will follow success stories of applying different forms of DI in several projects and focus on the outcomes as well as the potential pros and cons of using it.

We will establish why in an environment with constantly changing requirements [1] DI may play a crucial role if it comes to writing a maintainable/testable code with limited boilerplate and why "The only way to go fast is to go well".

The key point will be about comparing different ways [2], approaches [3] and frameworks [4] of accomplishing DI, each of which has different trade-offs, characteristics and which suits different applications.

At the end of this session, the audience will walk away with a clear understanding of possible use cases for DI, its benefits, as well as guidelines on how to correctly apply it.

Get ready to "inject all the things" at C++Now 2019!

[1]: "Nothing is certain in Software Development except for bugs and constantly changing requirements!" - the Franklin rule
[2]: Templates, Concepts, Type-Erasure, Inheritance, Variant - https://github.com/boost-experimental/di/tree/cpp14/example/polymorphism
[3]: Runtime/compile time injection - https://github.com/boost-experimental/di/tree/cpp14/benchmark
[4]: [Boost].DI - https://github.com/boost-experimental/di (not an official Boost library), Google.Fruit - https://github.com/google/fruit, Hyperdemic - https://github.com/ybainier/Hypodermic

avatar for Kris Jusiak

Kris Jusiak

Senior Software Engineer, Quantlab Financial, LLC
Kris is a Software Engineer with interest in modern C++ development, especially during compilation time where performance and quality matters. He has experience in industries such as telecommunications, games, and finance as well as being an open source enthusiast and author of the... Read More →

Monday May 6, 2019 16:30 - 18:00 MDT
Flug Auditorium
  case study
Tuesday, May 7

11:00 MDT

Linear Algebra for the Standard C++ Library
Linear algebra is a mathematical discipline of ever-increasing importance in today's world, with direct application to a wide variety of problem domains, such as signal processing, computer graphics, medical imaging, machine learning, data science, financial modeling, and scientific simulations. And yet, despite the relevance of linear algebra to so many aspects of modern computing, the C++ standard library does not include a set of linear algebra facilities.

This talk will describe a proposal before the C++ standardization committee (P1385) to add linear algebra to the standard library. We'll begin with a quick refresher on what linear algebra is and why it's so important. Next, we'll cover the features and high-level requirements for the proposed components, including a review of related mathematical objects deliberately excluded. We'll then discuss in detail the design of the proposed components, the evolution of that design, and its rationale. In particular, we'll discuss in depth how the requirements we set out to fulfill led directly to the design, and how modern C++ allows us to specify an extensible interface that is expressive, customizable, and supports high performance. Along the way, the talk will also provide some color commentary regarding the process of composing, submitting, and advocating a proposal for a significant new library feature.

avatar for Bob Steagall

Bob Steagall

Chief Cook and Bottle Washer, KEWB Computing

Tuesday May 7, 2019 11:00 - 12:30 MDT
Hudson Commons
  case study

14:30 MDT

Rise of the State Machines
In this case study, we will conduct a battle against different ways of implementing state machines in modern C++, each of which has different trade-offs and characteristics. We will use a connection [1] example to measure and compare varied aspects of each solution such as compilation time, run-time performance, memory usage, executable size, and readability.

In the first round, the Naive solutions will fight against Standard Template Library (STL) solutions. The Naive will be represented by the if/else and switch/enum, both of which could be classed as the 'old school' way of implementing state machines with implicit states defined by booleans and/or enums. On the other side, we will have STL, featured by C++17 - std::variant [2] and the newest addition to C++20 - coroutines [3]. These two can be used to demonstrate a new way of implementing state machines by leveraging modern C++ language features.

The winner will go on to take on the Boost libraries represented by Boost.Statechart [4] and Boost.MetaStateMachine (MSM) [5]. Both libraries are compliant with Unified Modeling Language (UML) standard [6] and have many additional features such as logging and/or serialization. Whilst Statechart is more run-time, the MSM represents a fully compile-time approach with minimal run-time overhead.

While our winners are recovering, we will introduce the final contender - [Boost].StateMachineLanguage (SML) library [7] - a C++14 version of Boost.MSM of which I'm the author and claimes to have much faster compilation times then its precursor. We will follow by some 'godbolting' (comparing a generated assembly) [8] of different dispatching techniques (branch, switch, jump table, fold expressions [9]) available in the library to illustrate the main power of the SML - the ability to change the feature set and behavior at compile-time.

After that, we will return to the final round, where the winner will battle against [Boost].SML.

At the end of this epic battle, the audience will walk out with a clear understanding of possible state machine implementations, their trade-offs, and with guidelines of what solutions suit what problems.

Let's get ready to rumble at C++Now 2019!

[1]: http://boost-experimental.github.io/sml/embo-2018/images/connection.png
[2]: http://en.cppreference.com/w/cpp/utility/variant
[3]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4736.pdf
[4]: http://www.boost.org/doc/libs/release/doc/html/boost_statechart.html
[5]: http://www.boost.org/doc/libs/release/doc/html/boost_msm.html
[6]: https://www.omg.org/spec/UML/2.5.1/PDF
[7]: https://github.com/boost-experimental/sml(Boost.SML is not an official Boost library)
[8]: https://godbolt.org/g/HVavPU
[9]: http://en.cppreference.com/w/cpp/language/fold

avatar for Kris Jusiak

Kris Jusiak

Senior Software Engineer, Quantlab Financial, LLC
Kris is a Software Engineer with interest in modern C++ development, especially during compilation time where performance and quality matters. He has experience in industries such as telecommunications, games, and finance as well as being an open source enthusiast and author of the... Read More →

Tuesday May 7, 2019 14:30 - 16:00 MDT
Flug Auditorium
Wednesday, May 8

11:00 MDT

A generic binary tree: why grow your own?
The binary tree is perhaps the most important non-linear data structure and yet there is no standard implementation, or implementation in Boost for that matter.
There are third-party library implementations such as in tree.hh by Kasper Peeters, or buried in a geometry library such as Pastel, but they doesn't have the rich graph theoretic concepts and algorithms established in Boost.Graph and they're designed as containers (using node-based allocation).
Boost.Graph has the compressed_sparse_row_graph, but it's not mutable and it doesn't have any binary tree concepts.
So this is the story of making a fresh generic binary tree implementation for Boost.Graph: satisfying the MutableGraph and BidirectionalGraph concepts whilst being competitive in performance to compressed_sparse_row_graph. (VertexListGraph is a work in progress.)
It's an unfinished story that is a few chapters in but probably needs your help to finish telling it.

As we know, a binary tree is a (very) special case of tree and it receives special attention in two particular books of note: The Art of Computer Programming by Donald Knuth and Elements of Programming by Alexander Stepanov & Paul McJones. It's from these two books that the bulk of the algorithms and data structures for a binary tree come from.
What's not in those books is how to put it all together in a single, efficient design. Although ostensibly the simplest non-linear data structure, a binary tree has a few significant design options on which it can be parameterized: trade-offs in achieving this through different class designs will be explored.
The structure too can be stored in various different ways, which will also be explored and ultimately compared for performance.

I'd like to leave a good chunk of time at the end for discussion on future directions, pathways to a standard graph library, etc.

avatar for Jeremy Murphy

Jeremy Murphy

Senior Software Engineer, ResMed
Jeremy started programming 25 years ago in C and finally discovered C++ in the C++0x days. He is interested in computational geometry, graph theory and the related data structures and algorithms. He has worked on molecular modelling, telecommunication network optimization, motion... Read More →

Wednesday May 8, 2019 11:00 - 12:30 MDT
Hudson Commons
  case study
Friday, May 10

11:00 MDT

The Plan for Tomorrow: Extension Points in C++ Applications
For years, the callback paradigm with a function pointer and sometimes a void pointer to some user data has dominated synchronous (and sometimes asynchronous) programming extension models in C. Yet later still, C++ code virtual classes, override-able (pure) functions have been used (and abused) with varying degrees of success in projects that seek to extend their functionality beyond what was originally programmed. Unfortunately, virtual classes are still too heavy for many cases where external-to-application extension was not really necessary, leaving developers to add various sorts of hooks and serialization which are increasingly being milled through templates and other extension points.

Is there something better than the typical callback paradigm or virtual class methods for allowing a user to hook a library or middleware's inner workings?

This case study will review several libraries and discuss the merits of their non-dynamic extension points, including virtual serialization in game engines, iostream higher order function mechanisms, sol3 and nlohmann::json. We will discuss the pros and cons of each, how extensible they end up being, and what limitations come from choices such as ADL extension (with and without priority tags) or struct template specialization. Come join us for a deep dive in what it means to allow a developer to extend your application with their types and routines at compile-time!

avatar for JeanHeyd Meneide

JeanHeyd Meneide

Student, Columbia Unviersity
JeanHeyd "ThePhD" is a student at Columbia University in New York. Most of his programming is for fun and as a hobby, even if his largest open-source contribution -- sol2 -- is used across many industries. He is currently working towards earning his own nickname, climbing the academic... Read More →

Friday May 10, 2019 11:00 - 12:30 MDT
Flug Auditorium
  case study