C++ day in Spain: using std::cpp 2015

The Spanish-language C++ event using std::cpp 2015 will gather C++ Spanish comunity in a full one day free event.

using std::cpp 2015

November 18, 2015

University Carlos III of Madrid in Leganés

For the 3rd year, University Carlos III of Madrid, hosts using std::cpp, an event for C++ software developers held in Spain. Past editions of using std::cpp have had participations around 200 people each year where 75% were professional software developers and the other 25% where academics and students. The event offers a godd opportunity for the Spanish C++ comunity to gather together and exchange experiences about the language as well as to provide udpdated information about the language.

Some program highlights:

  • Concepts Lite (Manu Sánchez, By Tech)
  • Contract based programming in C++ (J. Daniel García, University Carlos III)

You may access to videos and slides from previous years:

For more information you may contact J. Daniel Garcia.

More than you need--Andrzej KrzemieĊ„ski

Some thoughts about what the standard provides by default:

More than you need

by Andrzej Krzemieński

From the article:

The classes you design can do more (in terms of allowed operations) than what you could figure out from just looking at their member function declarations. The C++ Standard defines a number of cases where certain expressions involving your type are valid, even though there are no corresponding member function declarations. Sometimes this is just what you need; but sometimes the additional operations you never asked for can have grave negative impact on your program correctness...

 

CppCast Episode 31: JUCE with Julian Storer

Episode 31 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Julian Storer to discuss the JUCE library.

CppCast Episode 31: JUCE with Julian Storer

by Rob Irving and Jason Turner

About the Interviewee:

Jules has been developing audio and library software in C++ for over 15 years, and is the author of the JUCE library, the most widely used framework for audio applications and plugins. Music tech company ROLI acquired JUCE in 2014, and as well as continuing work on library itself, he helps to guide ROLI's other software projects.

He also created the Tracktion audio workstation in 2002, which is still going strong and being used by thousands of recording musicians around the world.

He lives in London, and likes to escape from the world of music technology by playing classical guitar.

Lambda hackery: Overloading, SFINAE and copyrights -- Nikos Athanasiou

Lambdas are often miscalled "functions"; learn how to implement some "function only" features in the article:

Lambda hackery: Overloading, SFINAE and copyrights

by Nikos Athanasiou

From the article:

If we think of lambdas as functions we’d might make an attempt to overload them. This attempt is easy to rebut by stating that lambdas are closures ie runtime objects and well … objects, even callable ones, do not overload! (...) The closest thing to a lambda that can overload is its function call operator, so you might already had your “aha!” moment by now. If not, here it is ...

Quick Q: What container should I use to reduce fragmentation caused by lots of small allocations?

Quick A: The only one matching the requirements is a std::deque, but it might be worth to consider using a memory pool.

Recently on SO:

What C++ std container should I use to reduce fragmentation caused by lots of small allocations?

Since you're asking specifically for a standard container, std::deque is the most promising option given your requirements. As long as you only add elements, the existing ones are not relocated, and references/pointers (but not iterators) remain valid. When removing elements, you may however need to leave gaps or swap the element to remove with the last element.

std::vector is not stable, and std::list, std::forward_list as well as all the associative containers are fragmented.

Looking at Boost.Container, you have additional options, however with other trade-offs:

boost::flat_map provides contiguous storage (like std::vector), but with it the stability problem
boost::stable_vector offers element stability at the cost of contiguity.
Alternatively, you can have a look at pool allocators (like Boost.Pool). They provide low fragmentation and fast allocation, and the container in front of it can still be used like a normal container.

Bitesize Modern C++ : Smart pointers--Glennan Carnie

Do you know about smart pointers?

Bitesize Modern C++ : Smart pointers

by Glennan Carnie

From the article:

The dynamic creation and destruction of objects was always one of the bugbears of C. It required the programmer to (manually) control the allocation of memory for the object, handle the object’s initialisation then ensure that the object was safely cleaned-up after use and its memory returned to the heap. Because many C programmers weren’t educated in the potential problems (or were just plain lazy or delinquent in their programming) C got a reputation in some quarters for being an unsafe, memory-leaking language...

CppCon 2015: Last online videos (5)

The videos of CppCon 2015 are coming online. You can see them all here: Youtube or Channel 9

Here are the most recent ones:

  • CLANG + C2 - Engineering/Futures/Measurements
  • C++ devirtualization in clang
  • Algorithmic Differentiation: C++ & Extremum Estimation

 

CLANG + C2 - Engineering/Futures/Measurements by James Radigan

The talk will cover the CLANG + c2.dll compiler for the Microsoft platform. It will contain parts of the talk given at //Build 2015 that can be found on line: "Compiling Objective-C Using the Visual Studio 2015 C++ Code Generation that Builds Windows, SQL, .Net, and Office". The focus this time will be on C++.

The talk will disclose the architecture of how we tied the CLANG open source front end with the Microsoft optimizing backends (several configurations are needed) and how far we are from providing a CTP for public consumption targeting 4 different architectures. Included in this section will be a disclosure of data on compile time, memory consumption, conformance and correctness.

In addition the talk will cover the nuts and bolts of several key innovative compiler and runtime technologies we will be delivering in the Visual Studio 2015 updates (Fall, Winter and Spring). New investments in the compiler and runtime space include: Improved optimization and auto-vectorization, more secure code generation, incremental whole program compilation, and new asynchronous C++ code generation.


C++ devirtualization in clang by Piotr Padlewski

Lightning Talk


Algorithmic Differentiation: C++ & Extremum Estimation by Matt P. Dziubinski

Lightning Talk

CppCon 2015: Last online videos (4)

The videos of CppCon 2015 are coming online. You can see them all here: Youtube or Channel 9

Here are the most recent ones:

  • CLANG + C2 - Engineering/Futures/Measurements
  • C++ devirtualization in clang
  • Algorithmic Differentiation: C++ & Extremum Estimation
  • Indian C++: Curry for your Functions
  • CLion Tips & Tricks
  • and seventeen more lightning talks!

 

CLANG + C2 - Engineering/Futures/Measurements by James Radigan

The talk will cover the CLANG + c2.dll compiler for the Microsoft platform. It will contain parts of the talk given at //Build 2015 that can be found on line: "Compiling Objective-C Using the Visual Studio 2015 C++ Code Generation that Builds Windows, SQL, .Net, and Office". The focus this time will be on C++.

The talk will disclose the architecture of how we tied the CLANG open source front end with the Microsoft optimizing backends (several configurations are needed) and how far we are from providing a CTP for public consumption targeting 4 different architectures. Included in this section will be a disclosure of data on compile time, memory consumption, conformance and correctness.

In addition the talk will cover the nuts and bolts of several key innovative compiler and runtime technologies we will be delivering in the Visual Studio 2015 updates (Fall, Winter and Spring). New investments in the compiler and runtime space include: Improved optimization and auto-vectorization, more secure code generation, incremental whole program compilation, and new asynchronous C++ code generation.


C++ devirtualization in clang by Piotr Padlewski

Lightning Talk


Algorithmic Differentiation: C++ & Extremum Estimation by Matt P. Dziubinski

Lightning Talk


Indian C++: Curry for your Functions by Andre Bergner

Lightning Talk


CLion Tips & Tricks by Dmitri Nesteruk

Lightning Talk

CppCon 2015: Last online videos (3)

The videos of CppCon 2015 are coming online. You can see them all here: Youtube or Channel 9

Here are the most recent ones:

  • CopperSpice: A Pure C++ GUI Library
  • C++ Metaprogramming: Journey from simple to insanity and back
  • Birth of Study Group 14...
  • C++11/14/17 atomics and memory model...
  • On C++, Javascript and WebSockets
  • C++ in Open Source Robotics
  • From Functional to Parallel: Stochastic Modeling in C++

 

CopperSpice: A Pure C++ GUI Library by Barbara Geller & Ansel Sermersheim

CopperSpice is a collection of cross platform GUI libraries derived from Qt 4.8. Our libraries use current C++11 technology to implement Reflection, without requiring moc (a code generator) or any preprocessing. We will discuss what Reflection is, how this technology can be used, and why it can be difficult to implement.

The focus of this presentation is to show the core implementation of CopperSpice. Source code from CopperSpice will be shown to explain how we implemented Reflection using pure C++11. We will also demonstrate small samples of code which use the CopperSpice libraries.

Technologies covered in this presentation will include templates, variadic templates, and template specialization.

No prior knowledge of CopperSpice or Qt is required. A working knowledge of templates in C++11 would be helpful.


C++ Metaprogramming: Journey from simple to insanity and back by Fedor Pikus

Part I: Introduction to template metaprogramming. Template metaprogramming is a variant of generic programming, a technique that uses C++ template mechanism to perform computations at compilation time, usually to generate, from a single description, executable code that depends on the properties of the data types. It can be viewed as “programming with types”. In this example-driven class we start with the overview of the metaprogramming tools (everything you wanted to know about template specializations but were afraid to ask). We will apply these tools to simple examples, such as: how to sort a sequence in order of increasing values, unless it’s a sequence of pointers, in which case we want the values of what they point to. Part II: Advanced techniques and practical applications. Simple examples of metaprogramming are fun and useful, but once you master them you start chafing at the limitations. This is C++, where we don’t suffer limitations gladly. We therefore move on to the more advanced techniques, including SFINAE, and the appropriately more advanced examples. The journey takes us back to the beginning: after all, when sorting a sequence of values vs a sequence of pointers, you don’t really care whether the pointer is smart or dumb. What you really want to know is whether “*p” compiles or not. What you really need is an “if_compiles” metaprogramming function.


Birth of Study Group 14... by Nicolas Guillemot & Sean Middleditch

C++ is paramount for games development, and low-latency real-time applications everywhere. But has it recall improved since C++98/03? What features in C++ 11/14 has helped, and what else do we still need from C++ 17/22? In last year's CPPCon, there was clearly demand for even better support for this community as evidenced by the large number of games submission and an impromptu BoF.

But this industry has a demanding schedule and cannot freely attend ISO C++ standard meetings. So when the prophet cannot go to the mountain, the mountain has decided to come to the prophet!

This year, we like to announce the formation of an official SG14 that will go where the community is, at CppCon 2015 will be an official SG14 meeting followed by an SG14 meeting at GDC 2015 hosted by Sony.

This talk will describe the initial findings of the unofficial real time google group https://groups.google.com/forum/#!for... as described in: http://www.open-std.org/jtc1/sc22/wg2... where we considered improvements such as flat map, intrusive container, and other suggestions for better support for games development and low latency in ISO C++.


C++11/14/17 atomics and memory model... by Michael Wong

In 2011, C++11 atomics offered three memory models but 6 settings. Most compilers have started implementing most of these (relaxed, seq_cst, acquire, release, acq_rel) but not consume (For that you will need to see Paul's talk which naturally follows this talk.) For this, I will deep dive into what each memory model setting means (especially for Games Development and low latency, a new SG14 in the C++ Standard) and how C++11 atomics are used to improve handling of mutable shared state. We have improved on it in C++14 and have more crazy things planned for C++17. I will also look at how C++ atomics are a natural precursor to SG5's Transactional Memory which was approved in Lenexa for publication.


On C++, Javascript and WebSockets by Alex Fabijanic

Session presents Open Service Platform (OSP) - an application server engine inspired by OSGi, consisting of C++ and JavaScript runtime environments; OSP is based on the POCO C++ Libraries, with embedded Google V8 JavaScript engine.

A brief overview of the application server and underlying technologies will be given, followed by dissection of the most interesting implementation details - C++-to-JavaScript bridging mechanism and WebSocket-based messaging mechanism for transparent intra- and inter-process scalable communications. The language bridging mechanism exposes the C++ classes to JavaScript code without a need for manually written glue code or separate IDL constructs for interfaces. The messaging mechanism provides a unified, event-based interface for the in-process entities as well as those reachable over the network - be it TCP/HTTP server or a web browser.

Key design aspects, advantages, as well as trade-offs will be examined; a live example demonstrating key technologies in action will be presented.


C++ in Open Source Robotics by Jackie Kay & Louise Poubel

The robotics community is thriving in part due to flexible, powerful, accessible open source tools. The Open Source Robotics Foundation is a non-profit organization dedicated to the development, distribution, and adoption of open source software in robotics. We enable academics to focus on high-level research by re-using code, robotics startups to keep their development costs lean, and novice users to engage with powerful, complex robotics technology.

The first half of this talk centers around the future of ROS, the most widely used open source framework for robotics. After an overview of ROS transport, tools, capabilities, and the diverse ecosystem of ROS-compatible libraries, we will motivate the development of ROS 2: a major API change that targets new use cases for ROS, including embedded hardware, multi-robot systems, and real-time performance. Starting with an overview of the ROS 2 architecture, which includes a modern C++11 client library built on top of a generic DDS middleware interface, we will then focus on two core user code examples: publish/subscribe over a topic, and client request/service response. After this half of the presentation, attendees will understand C++ is a dominant language choice for robotics and why C++11 makes it easy to build a flexible, modular, Boost-free framework for communication and synchronization.

The second half of the talk focuses on Gazebo, a simulator for robotics that features support for multiple rigid body dynamics physics engines, high quality graphics, and a flexible C++ API. Simulation software like Gazebo is of utmost importance for developing controller algorithms, prototyping robot designs, and regression testing in challenging environments. It has been used in high­-stakes competitions such as the DARPA Robotics Challenge. This talk will delve into how different components of the simulator interact, from calculating the physical interactions between objects to rendering graphics with OGRE. We will also discuss upcoming features in Gazebo and the process of tailoring our development to our community.


From Functional to Parallel: Stochastic Modeling in C++ by Kevin Carpenter

Come with us as we take a legacy MFC financial modelling application that is largely function in design and transform it to something new. We will take a portion of this large financial simulation application and change its single threaded ways into parallel processing stochastic model. Transforming single class’s with a hodge-podge of functions into an object oriented parallel design using c++ amp and implementing Stochastic modelling methodology. Aside from focusing on the key portions of converting functional single threaded code to a parallel design we will also touch on some of the details of financial modeling for interest rate risk.

Do You Prefer Fast or Precise?--Jim Hogg

A nice article explaining the troubles of float numbers, and what effects it can have. It is talking in the case of Visual C++, but the problems are the same for other compilers.

Do You Prefer Fast or Precise?

by Jim Hogg

From the article:

Floating Point Basics

In C++, a float can store a value in the 3 (approximate) disjoint ranges { [-E+38, -E-38], 0, [E-38, E+38] }. Each float consumes 32 bits of memory. In this limited space, a float can only store approximately 4 billion different values. It does this in a cunning way, where adjacent values for small numbers lie close together; while adjacent values for big numbers lie far apart. You can count on each float value being accurate to about 7 decimal digits.

Floating Point Calculations

We all understand how a computer calculates with ints. But what about floats? One obvious effect is that if I add a big number and a small number, the small one may simply get lost. For example, E+20 + E-20 results in E+20 – there are not enough bits of precision within a float to represent the precise/exact/correct value...