Do compilers take inline as a hint?--Simon Brand

Isn't that a good question?

Do compilers take inline as a hint?

by Simon Brand

From the article:

If you’ve spent any time in C or C++ communities online, you’ve probably seen someone say this:

inline used to be a hint for compilers to inline the definition, but no compilers actually take that into account any more.

You shouldn’t believe everything you see on the internet...

Producer-consumer with buffer swapping -- Krzysztof Ostrowski

Synchronisation cost minimisation technique explained based on the classic producer-consumer problem.

Lock less with swapped buffers

by Krzysztof Ostrowski

From the article:

Presented approach keeps the shared resource synchronised, but unblocks the producer execution for the time of the buffer items' consumption to achieve significant gain in overall performance of the solution and its reliability.

CppCast Episode 135: Think-Cell Ranges with Arno Schödl

Episode 135 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Arno Schödl to talk about the work he does at think-cell with C++ and their custom range library.

CppCast Episode 135: Think-Cell Ranges with Arno Schödl

by Rob Irving and Jason Turner

About the interviewee:

Arno Schödl, Ph.D. is the Co-Founder and Technical Director of think-cell Software GmbH, Berlin. think-cell is the de facto standard when it comes to professional presentations in Microsoft PowerPoint. Arno is responsible for the design, architecture and development of all our software products. He oversees think-cell’s R&D team, Quality Assurance and Customer Care. Before founding think-cell, Arno worked at Microsoft Research and McKinsey & Company. Arno studied computer science and management and holds a Ph.D. from the Georgia Institute of Technology with a specialization on Computer Graphics.

Abseil's String Utility APIs -- Tom Manshreck

Abseil's C++ Tips of the Week for January 26th

Abseil's String Utility APIs

by Tom Manshreck, Abseil Tech Writer

About the article:

Abseil provides many important string utilities such as StrCat(), StrSplit() and StrJoin(). Read the tips that introduced these APIs at Google and explain how to use them now at https://abseil.io/tips/3  https://abseil.io/tips/10 , https://abseil.io/tips/36  and https://abseil.io/tips/59.

C++17: Initializers for if & switch statements--Marc Gregoire

Small reminder:

C++17: Initializers for if & switch statements

by Marc Gregoire

From the article:

Two small, but very useful C++17 features are initializers for if and switch statements. These can be used to prevent polluting the enclosing scope with variables that should only be scoped to the if and switch statement. The for statement already supports such initializers since the beginning...

Quick Q: Is (4 > y > 1) a valid statement in C++? How do you evaluate it if so?

Quick A: This is not a valid statement.

Recently on SO:

Is (4 > y > 1) a valid statement in C++? How do you evaluate it if so?

The statement (4 > y > 1) is parsed as this:

((4 > y) > 1)

The comparison operators < and > evaluate left-to-right.

The 4 > y returns either 0 or 1 depending on if it's true or not.

Then the result is compared to 1.

In this case, since 0 or 1 is never more than 1, the whole statement will always return false.