Meeting 8 March 2018

C++ Developer Survey “Lite” 2018-02 Results

PDF

Visual Studio 2017 version 15.6 released

Chrome switches to Clang on Windows, ditches MSVC

Building Chrome locally with Clang is about 15% slower than with MSVC.

Accio Dependency Manager, by Corentin Jabot

See also:

East const

const modifies what is on its left. Unless there is nothing on its left, in which case it modifies what’s on its right.

C++: Thoughts on Dealing with Signed/Unsigned Mismatch

Matters discussed here are related to mitigation of certain decisions which were made 50+ years ago and which are pretty much carved in stone now.

Developers, while trying to get rid exactly of signed/unsigned warning, turned a perfectly-working-program-with-warnings, into a program-without-warnings-but-which-fails-once-a-day-or-so.

Stealth features responsible for half of F-35 defects

<…> so-called quality escapes — errors made by Lockheed’s workforce that could include drilling holes that are too big or installing a dinged part

C++ Metaprogramming

The main “rule” when doing template metaprogramming is, “if the value yield by such an expression is non-sensical, this function / class / etc… is skipped”

C++:

 1template <
 2    typename T
 3  , std::enable_if_t<
 4      std::negation_v<
 5        std::conjunction<
 6            std::is_arithmetic<T>::type
 7          , std::is_same<T, QStringList>::type
 8        >
 9      >
10    >* = nullptr>
11QDataStream& operator>>(QDataStream& stream, T& obj);

Lisp:

1(enable_if
2   (not
3    (and
4     (is_arithmetic T)
5     (is_same T QStringList)
6    )
7   )
8  )

Non-virtual destructors

 1struct B {
 2  B() { std::cout << 'b'; }
 3  ~B() { std::cout << 'B'; }
 4};
 5struct D : B {
 6  D() { std::cout << 'd'; }
 7  ~D() { std::cout << 'D'; }
 8};
 9int main() {
10  B* p = new D;
11  delete p;
12}

shared_ptr reference count for nullptr

StackOverflow

1shared_ptr<int> sptr2(nullptr);
2cout << "sptr2 use_count: " << sptr2.use_count() << endl;
3
4shared_ptr<int> sptr6(nullptr, default_delete<int>());
5cout << "sptr6 use_count: " << sptr6.use_count() << endl;

Output:

sptr2 use_count: 0
sptr6 use_count: 1

Twitter

Stephan T. Lavavej:

Unintentional Zen-like saying in the C++17 Standard: “If the path is empty, stop.”