June 2018

App-level Developer on std::error Exceptions Proposal for C++. Part II. The Discussion.--"No Bugs" H

Nothing is easy.

App-level Developer on std::error Exceptions Proposal for C++. Part II. The Discussion.

by "No Bugs" Hare

From the article:

For quite a long while, in certain parts of C++ community, there is a substantial resistance to existing C++ exceptions; this leads to an alternative subculture of using error codes instead of exceptions, so there are effectively two barely-compatible C++ worlds: world-using-exceptions, and world-using-error-codes...

CopperSpice: Overload Resolution

New video on the CopperSpice YouTube Channel:

Overload Resolution

by Barbara Geller and Ansel Sermersheim

About the video:

This video discusses overload resolution and the complications involved in debugging when the compiler does not choose the overload you think it should. This video was very interesting to put together, since we had no idea how much of the standard you need in order to understand the intricacies of overload resolution. Not only is overload resolution complex, but you also need to understand the details of type conversions and template argument deduction.

Please take a look and remember to subscribe!

Revisting Regular Types -- Titus Winters

An updated discussion on C++ type design, especially the overlap between Regular and reference types.

Revisiting Regular Types

By Titus Winters

From the article:

With 20 years of experience, we know that Regular type design is a good pattern - we should model user-defined types based on the syntax and semantics of built-in types where possible. However, common formulations of Regular type semantics only apply to values, and for performance reasons we commonly pass by reference in C++. In order to use such a reference as if it were its underlying Regular type we need some structural knowledge of the program to guarantee that the type isn’t being concurrently accessed. Using similar structural knowledge, we can treat some non-Regular types as if they were Regular, including reference types which don’t own their data. Under such an analysis, string_view indeed behaves as if it were Regular when applied to common usage (as a parameter). However, span does not, and further it is (currently) impossible to have shallow copy, deep compare, and Regular const semantics in the same type in C++.

This analysis provides us some basis to evaluate non-owning reference parameters types (like string_view and span) in a practical fashion, without discarding Regular design.

Automatic Object Linkage, with Include Graphs -- Thomas Young

For C++ code-bases with multiple targets and shared code elements, static libraries are kind of the default approach, but is there a better way to set this up?

Automatic Object Linkage, with Include Graphs

by Thomas Young

From the article:

In this post I describe an alternative approach to sharing source code elements between multiple build targets.

 

...

We'll need to enforce some constraints on the way the source code is set up, notably with regards to header file organisation, but can then automatically determine what to include in the link operation for each build target, based on a graph of include relationships extracted from the source files.

The resulting dynamic, fine grained, object-file centric approach to code sharing avoids the need for problematic static library decomposition, and the associated 'false dependencies'.

Transforming std::find into std::ranges::find -- Christopher Di Bella

Today, we dive into what std::find does, and how we can leverage various concepts to cleanly express its requirements, as achieved in std::ranges::find.

Transforming std::find into std::ranges::find

By Christopher Di Bella

From the article:

... The code is nearly the same, but not quite. Where it differs is in how we determine the end of the sequence, how we take the successor of our current element, and how we retrieve the value. While this is conceptually the same, it’s implementationally different.

...

Iterators are a topic rich with mathematics. Because they are part of what makes generic programming so powerful, this topic spans multiple chapters in books on generic programming.

...

we’ll now refine find to consider the EqualityComparableWith concept that we laboured over in the last article....

CppCast Episode 152: C++ London Uni with Tom Breza, Oliver Ddin and Tristan Brindle

Episode 152 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Tom Breza, Oliver Ddin and Tristan Brindle to discuss the C++ London Uni group and their approach to teaching C++ to the community.

CppCast Episode 152: C++ London Uni with Tom Breza, Oliver Ddin and Tristan Brindle

by Rob Irving and Jason Turner

About the interviewees:

Tom arrived in London at age 22 with £200 to his name, not knowing a single person. After 6 months Tom managed to start business - PC Service, that provides IT support to SMBs and runs it since then. Tom's team help many customers from small businesses to top celebrities and Royal Families. Now with over 20 years of experience, Tom set his mind on new challenges and decided to learn software development, specifically C++ and helps others to learn through C++ London Uni.

Oliver has been a C++ hater since 2008 - fortunately, that all changed with C++11 and he's firmly an enthusiast now. He's spent his time doing everything from embedded devices to network engineering and now Internet security related endeavours. He's a big proponent of writing software in a style driven by some form of testing and its place in pushing you towards well-architected, maintainable code. In his spare time he also co-organises C++ London Uni which provides free lessons for people wanting to get into developing C++ and the wider ecosystem around it.

Tristan is an independent contractor and C++ enthusiast based in London. He’s particularly interested in standardisation and making C++ an easier language to use and teach. He can be found on Twitter @tristanbrindle and occasionally blogs about C++ at tristanbrindle.com.