Simplifying templates and #ifdefs with if constexpr--Simon Brand

The new if constexpr will change a good part of our code for the better!

Simplifying templates and #ifdefs with if constexpr

by Simon Brand

From the article:

if constexpr is a C++17 feature which allows conditionally compiling code based on template parameters in a clear and minimal fashion. It is essentially an if statement where the branch is chosen at compile-time, and any not-taken branches are discarded without being instantiated...

Capturing perfectly-forwarded objects in lambdas -- Vittorio Romeo

Does [x = std::forward<decltype(x)>] behave like you expect?

capturing perfectly-forwarded objects in lambdas

by Vittorio Romeo

From the article:

Perfect forwarding and forwarding references allow developers to write generic template functions that retain the lvalueness/rvalueness of passed arguments [...] Let's try to use auto&&, std::forward and C++14's generalized lambda capture syntax to implement our desired semantics. [...] What we really want to do is:

  • Capture by copy if a is an rvalue reference.
  • Capture by reference if a is an lvalue reference.

[...]

Technical Debt - More Captureless Lambda Fun -- Adi Shavit

More interesting facts about captureless lambdas.

Technical Debt

by Adi Shavit

From the article:

The series on captureless lambdas generated some interesting comments.  
The articles discusses converting captureless lambdas into function pointers without explicitly specifying the cast-to type, calling conventions and standard conformance and a special callbackizing function for capturing lambdas.

Slides of the 24th of November 2016 BeCPP Meeting

BeCPP_Logo_282x64.pngOn 24th of November, the Belgian C++ Users Group had their next event sponsored by Nikon Metrology.

Slides of the 24th of November 2016 BeCPP Meeting

There were two presentations:

  • "Mobile App Development for Multiple Platforms with Visual C++, 2016" (Marc Gregoire)
  • "What’s new in C++17?" (Peter Van Weert)

If you couldn’t attend the event in person, or if you would like to go over the material again, you can download them from the BeCPP website.

The view from Nov 2016 C++ Standard Meeting Issaquah

Hi all, I have been on airplanes for the last 10 weeks in a row, starting with CPPCON 2016 on September 16 2016. But first, I wanted to update everyone on the latest status of the C++ Standard meeting from Issaquah on Nov 7, 2016. Here is a blog post where you can see a video of what is coming for C++17 and download the slides. You can also see what happened in Issaquah for Evolution, Parallelism, Concurrency, and the latest status of the National Body Comments:

https://wongmichael.com/2016/12/09/the-view-from-nov-2016-c-standard-meeting-issaquah/

CppCast Episode 81: C++ Game Development at Ubisoft with Nicolas Fleury

Episode 81 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Nicolas Fleury, Technical Architect at Ubisoft Montreal, to talk about the development and performance tuning techniques used at Ubisoft on games like Rainbow Six Siege.

CppCast Episode 81: C++ Game Development at Ubisoft with Nicolas Fleury

by Rob Irving and Jason Turner

About the interviewee:

Nicolas has 13 years of experience in the video game industry, more years in the software industry in telecoms, in speech recognition and in computer assisted surgery. Technical Architect on Tom Clancy's: Rainbow Six Siege, he is one of the key Architects behind some collaboration initiatives at Ubisoft and was also Technical Architect on games like Prince of Persia. He presented at CppCon 2014 "C++ in Huge AAA Games".

2016-11 post-Issaquah mailing available

The 2016-11 mailing of new standards papers is now available.

NOTE: A number of these papers have already been publicized on this blog. This is the complete list including ones not previously publicized.

 

N4615 WG21 2016-10-28 Telecon Minutes Jonathan Wakely 2016-10-28 2016-11   WG21  
N4616 Response to NB Comments: SC22 N5097, ISO/IEC PDTS 19568 Part 2, Library Fundamentals, Part 2 Barry Hedquist 2016-11-12 2016-11   WG21  
N4617 Programming Languages -- C++ Extensions for Library Fundamentals, Version 2 DTS Geoffrey Romer 2016-11-28 2016-11   WG21  
N4618 Working Draft, Standard for Programming Language C++ Richard Smith 2016-11-28 2016-11 N4606 WG21  
N4619 Editor's Report -- Working Draft, Standard for Programming Language C++ Richard Smith 2016-11-28 2016-11   WG21  
N4620 Working Draft, C++ Extensions for Ranges Eric Niebler, Casey Carter 2016-11-27 2016-11   WG21  
N4621 Editor's Report for the Ranges TS Casey Carter 2016-11-27 2016-11   WG21  
N4622 Programming Languages -- C++ Extensions for Ranges PDTS Eric Niebler, Casey Carter 2016-11-27 2016-11   WG21  
N4623 WG21 2016-11 Issaquah Minutes Jonathan Wakely 2016-11-28 2016-11   WG21  
N4624 PL22.16 2016-11 Issaquah Minutes Jonathan Wakely 2016-11-28 2016-11   WG21  
N4625 Programming Languages -- C++ Extensions for Networking PDTS Jonathan Wakely 2016-11-28 2016-11   WG21  
N4626 Working Draft, C++ Extensions for Networking Jonathan Wakely 2016-11-28 2016-11 N4612 WG21  
N4627 Networking TS - Editor's Report Jonathan Wakely 2016-11-28 2016-11   WG21  
N4628 Working Draft, Technical Specification on C++ Extensions for Coroutines Gor Nishanov 2016-11-27 2016-11   WG21  
N4629 Editor's report for the Coroutines TS Gor Nishanov 2016-11-27 2016-11   WG21  
N4630 Working Draft, C++ extensions for Concepts Andrew Sutton 2016-11-28 2016-11 N4549 WG21  
N4631 Editor's report for the Concepts TS Andrew Sutton 2016-11-28 2016-11   WG21  
P0003R5 Removing Deprecated Exception Specifications from C++17 Alisdair Meredith 2016-11-11 2016-11 P0003R4 Core  
P0019R4 Atomic View H. Carter Edwards, Hans Boehm, Olivier Giroux, James Reus 2016-11-09 2016-11 P0019R3 Library Evolution  
P0020R4 Floating Point Atomic H. Carter Edwards, Hans Boehm, Olivier Giroux, JF Bastien, James Reus 2016-11-09 2016-11 P0020R3 Library Evolution  
P0053R3 DRAFT C++ Synchronized Buffered Ostream Lawrence Crowl, Peter Sommerlad, Nicolia Josuttis 2016-11-12 2016-11 P0053R2 Library Evolution, Concurrency, Library  
P0057r7 Wording for Coroutines Gor Nishanov 2016-11-11 2016-11 P0057r6 Core, Library  
P0067R5 Elementary string conversions, revision 5 Jens Maurer 2016-11-11 2016-11 P0067R4 Library  
P0100R2 Comparison in C++ Lawrence Crowl 2016-11-27 2016-11 P0100R1 Evolution  
P0156R1 Variadic lock_guard (Rev. 4) Mike Spertus 2016-10-21 2016-11 P0156R0 Library  
P0195R2 Pack expansions in using-declarations Robert Haberlach, Richard Smith 2016-11-08 2016-11 P0195R1 Core  
P0237R4 Wording for fundamental bit manipulation utilities Vincent Reverdy, Robert J. Brunner 2016-11-28 2016-11 P0237R3 Library Evolution, SG14, Numerics  
P0266R2 Lifting Restrictions on requires-Expressions Walter E. Brown 2016-11-10 2016-11 P0266R1 Core  
P0270R2 Removing C dependencies from signal handler wording Hans Boehm 2016-11-27 2016-11 P0270R1 Core, Library  
P0298R2 A byte type definition Neil MacIntosh 2016-11-11 2016-11 P0298R1 Library Evolution  
P0304R1 C++ Standard Library Issues Resolved Directly In Issaquah Marshall Clow 2016-11-11 2016-11 P0304R0 Library  
P0306R2 Comma elision and comma deletion Thomas Koeppe 2016-11-27 2016-11 P0306R1 Evolution, Core, WG14  
P0329R2 Designated Initialization Wording Tim Shen, Richard Smith 2016-11-21 2016-11 P0329R1 Core  
P0370R3 Ranges TS Design Updates Omnibus Casey Carter, Eric Niebler 2016-11-17 2016-11 P0370R2 Library  
P0403R1 Literal suffixes for basic_string_view Marshall Clow 2016-11-09 2016-11 P0403R0 Library Evolution  
P0414R2 Merging shared_ptr changes from Library Fundamentals to C++17 Jonathan Wakely 2016-11-10 2016-11 P0414R1 Library  
P0417R1 C++17 should refer to ISO/IEC 10646 2014 instead of 1994 (R1) Beman Dawes 2016-11-25 2016-11 P0417R0 Core, Library  
P0418R2 Fail or succeed: there is no atomic lattice JF Bastien 2016-11-09 2016-11 P0418R1 Concurrency, Library  
P0426R1 Constexpr for std::char_traits Antony Polukhin 2016-11-08 2016-11 P0426R0 Library Evolution  
P0430R1 File system library on non-POSIX-like operating systems Jason Liu, Hubert Tong 2016-11-24 2016-11 P0430R0 Library, Library Evolution  
P0431R0 Correcting Evaluation Order for C++ Hyman Rosen 2016-09-14 2016-11   Evolution, Core  
P0435R1 Resolving LWG Issues re common_type Walter E. Brown 2016-11-11 2016-11 P0435R0 Library  
P0436R1 An Extensible Approach to Obtaining Selected Operators Walter E. Brown 2016-11-09 2016-11 P0436R0 Evolution  
P0440R1 Floating Point Atomic View H. Carter Edwards, Hans Boehm, Olivier Giroux, JF Bastien, James Reus 2016-11-09 2016-11 P0440R0 Library Evolution  
P0441R1 Ranges: Merging Writable and MoveWritable Casey Carter, Eric Niebler 2016-11-17 2016-11 P0441R0 Library  
P0464R1 Revisiting the meaning of "foo(ConceptName,ConceptName)" Tony Van Eerd, Botond Ballo 2016-11-08 2016-11 P0464R0 Evolution  
P0476R1 Bit-casting object representations JF Bastien 2016-11-11 2016-11 P0476R0 Library Evolution, Library, Core  
P0490R0 Core language changes addressing National Body comments for CD C++17 Jens Maurer 2016-11-11 2016-11   Core  
P0492R0 Proposed Resolution of C++17 National Body Comments for Filesystem Beman Dawes, S. Davis Herring, Nicolai Josuttis, Jason Liu, Billy O'Neal, P.J. Plauger, Jonathan Wakely 2016-11-26 2016-11   Library  
P0493R0 Atomic maximum/minimum Al Grant, Bronek Kozicki 2016-11-08 2016-11   Library Evolution, Concurrency  
P0494R0 contiguous_container proposal Ildus Nezametdinov 2016-11-05 2016-11   Library Evolution, SG14  
P0495R0 Concurrency Safety in C++ Data Structures Lawrence Crowl 2016-11-27 2016-11   Concurrency  
P0497R0 Fixes to shared_ptr support for arrays Jonathan Wakely 2016-11-10 2016-11   Library  
P0500R0 Resolved Module TS (N4610) Issues Gabriel Dos Reis 2016-11-11 2016-11   Core  
P0502R0 Throwing out of a parallel algorithm terminates--but how? JF Bastien, Bryce Adelstein Lelbach, H. Carter Edwards 2016-11-09 2016-11   Concurrency, Library  
P0503R0 Correcting library usage of "literal type" Erich Keane 2016-11-09 2016-11   Library  
P0504R0 Revisiting in-place tag types for any/optional/variant Jonathan Wakely 2016-11-09 2016-11   Library  
P0505R0 Wording for GB 50 Howard Hinnant 2016-11-09 2016-11   Library  
P0507R0 Core Issue 1343: Sequencing of non-class initialization Jens Maurer 2016-11-10 2016-11   WG21  
P0508R0 Wording for GB 58 Howard Hinnant 2016-11-10 2016-11   Library  
P0509R0 Updating "Restrictions on exception handling" James Dennett 2016-11-10 2016-11   Library  
P0510R0 Disallowing references, incomplete types, arrays, and empty variants Erich Keane 2016-11-10 2016-11   Library  
P0511R0 Deduction guide for std::array Zhihao Yuan 2016-11-09 2016-11   Library Evolution  
P0512R0 Class Template Argument Deduction Assorted NB resolution and issues Mike Spertus, Richard Smith, Faisal Vali 2016-11-10 2016-11   Core  
P0513R0 Poisoning the Hash Lisa Lippincott 2016-11-10 2016-11   Library  
P0514R0 Enhancing std::atomic_flag for waiting Olivier Giroux 2016-11-15 2016-11   Concurrency  
P0516R0 Clarify That shared_future's Copy Operations have Wide Contracts Bryce Adelstein Lelbach 2016-11-10 2016-11   Concurrency, Library Evolution, Library  
P0517R0 Make future_error Constructible Bryce Adelstein Lelbach 2016-11-10 2016-11   Concurrency, Library Evolution, Library  
P0519R0 Core Language Working Group "ready" Issues for the November, 2016 (Issaquah) meeting William M. Miller 2016-11-11 2016-11   Core  
P0520R0 Core Language Working Group "tentatively ready" Issues for the November, 2016 (Issaquah) meeting William M. Miller 2016-11-11 2016-11   Core  
P0521R0 Proposed Resolution for CA 14 (shared_ptr use_count/unique) Stephan T. Lavavej 2016-11-11 2016-11   Concurrency, Library Evolution, Library  
P0522R0 DR: Matching of template template-arguments excludes compatible templates James Touton, Hubert Tong 2016-11-11 2016-11   Core  
P0523R0 Wording for CH 10: Complexity of parallel algorithms Detlef Vollmann 2016-11-11 2016-11   Concurrency, Library  
P0528R0 The Curious Case of Padding Bits, Featuring Atomic Compare-and-Exchange JF Bastien, Michael Spencer 2016-11-12 2016-11   Concurrency, Library Evolution, Library, Core  
P0529R0 Wording changes for proposed Modules TS extensions Richard Smith 2016-11-23 2016-11   Evolution  

 

C++ 17 Transformation...--phantom

The transformation is only a beginning towards catching up from C++98, but it does show why modern C++ features improve your code.

C++ 17 Transformation...

by phantom

From the article:

I'm basically really bad at working on my own projects, but with the recent release of Visual Studio 2017 RC and its improved C++17 support I figured it was time to crack on again...

To that end I've spent a bit of time today updating my own basic windowing library to use C++17 features. Some of the things have been simple transforms such as converting 'typedef' to 'using', others have been more OCD satisfying...