June 2017

Making things do stuff – Part 5—Glennan Carnie

The series continues.

Making things do stuff – Part 5

by Glennan Carnie

From the article:

We’ve been looking at using C++ to manipulate I/O hardware.   Previously, we’ve looked at the fundamentals of hardware manipulation; and how to encapsulate these mechanisms into classes.  If you’ve not been following along I’d recommend reading the previous articles first before continuing.

This time we’ll explore a lesser-known feature of C++ and its application in hardware manipulation – placement new...

CppCon 2016: AAAARGH!? Adopting Almost Always Auto Reinforces Good Habits!?—Andy Bond

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

AAAARGH!? Adopting Almost Always Auto Reinforces Good Habits!?

by Andy Bond

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Prominent members of the C++ community are advocating the "almost-always-auto" idiom, but there are understandable concerns from many about its implications. This case study will demonstrate how it may be applied in different situations, suggest ways to avoid performance penalties, introduce algorithms to minimize the "almost" part, and discuss the overall impact.

PVS-Studio 6.16 released

PVS-Studio is a static code analyzer that detects errors and potential vulnerabilities in the source code of programs written in C/C++/C#. Version 6.16 has obtained 11 new general analysis diagnostics.

PVS-Studio 6.16 released

by Andrey Karpov

About the release:

In a sense, this is a milestone for us. The thing is that we cannot add more numbers of general analysis warnings, otherwise they will concur with the numbers of micro-optimization diagnostics. It seemed to us that the list of 300 diagnostics was endless, but now it is over and we got to the point of 800, where we have micro-optimization diagnostics. In the next release we plan to resume numbering the general-analysis warnings with V1000. Download and enjoy the new version of PVS-Studio now by clicking here.

P.S. How to use PVS-Studio for Free.

P0724R0: Merge the Concepts TS Working Draft into the C++20 working draft—Ville Voutilainen

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: P0724R0

Date: 2017-06-27

Merge the Concepts TS Working Draft into the C++20 working draft

by Ville Voutilainen


The proposal is to merge the Concepts TS Working Draft into the C++20 Working Draft as is, and fix remaining issues, including design issues, before the publication of C++20.

Making things do stuff – Part 4—Glennan Carnie

The series continues.

Making things do stuff – Part 4

by Glennan Carnie

From the article:

In the last article we explored the design of a class to encapsulate a physical hardware device.  In that article I deliberately ignored how the class would actually interact with the hardware.

In this article we explore the options available to us for accessing hardware and the consequences of those choices...

A unique_ptr pool—Jens Weller

Discussion regarding self contained unique_ptr pool implementation.

A unique_ptr pool

by Jens Weller

From the article:

A few weeks ago I wrote about a self-contained unique_ptr pool, which today I refactored into a more reuseable template. Reason is, that the pool class it self now needs to maintain two different kind of objects into their pools,  hence the actual pool code is best now factored out into a template.

2017-06 pre-Toronto mailing available

The full 2017-06 mailing of new standards papers is now available.


2017-06 pre-Toronto
N4662 PL22.16/WG21 draft agenda: 10-15 Jul 2017, Toronto, ON, CA Clark Nelson 2017-03-27 2017-06   WG21  
N4663 Coroutines PDTS document Gor Nishanov 2017-03-25 2017-06   WG21  
N4664 Responses to National Body Comments for ISO/IEC CD 14882 Barry Hedquist 2017-03-30 2017-06   WG21  
N4665 WG21 telecon meeting: Pre-Toronto Herb Sutter 2017-06-01 2017-06   WG21  
N4666 National Body Comments, SC22 N 5205, ISO/IEC PDTS 22277, C++ Extensions for Coroutines Barry Hedquist 2017-06-05 2017-06   WG21  
N4667 Working Draft, Extensions to C++ for Modules Gabriel Dos Reis 2017-03-19 2017-06 N4647 WG21  
N4668 Editor's Report for the Module TS Gabriel Dos Reis 2017-06-19 2017-06   WG21  
N4669 Working Draft, Technical Specification for C++ Extensions for Parallelism Version 2 Jared Hoberock 2017-06-19 2017-06 N4578 WG21  
N4670 Parallelism TS Editor's Report, pre-Toronto mailing Jared Hoberock 2017-06-19 2017-06   WG21  
N4671 Working Draft, C++ Extensions for Ranges Casey Carter 2017-06-18 2017-06   WG21  
N4672 Editor's Report for the Ranges TS Casey Carter 2017-06-19 2017-06   WG21  
N4673 Sping 2018 WG21 Meeting Information (Rapperswil) Peter Sommerlad 2017-06-18 2017-06   WG21  
N4674 Working Draft, C++ extensions for Concepts Andrew Sutton 2017-06-19 2017-06 N4641 WG21  
N4675 Editor's report for the Concepts TS Andrew Sutton 2017-06-18 2017-06   WG21  
P0052R4 Generic Scope Guard and RAII Wrapper for the Standard Library Peter Sommerlad, Andrew L. Sandoval 2017-06-16 2017-06 P0052R3 Library  
P0053R4 DRAFT C++ Synchronized Buffered Ostream Lawrence Crowl, Peter Sommerlad, Nicolia Josuttis 2017-03-02 2017-06 P0053R3 Library Evolution, Concurrency, Library  
P0053R5 DRAFT C++ Synchronized Buffered Ostream Lawrence Crowl, Peter Sommerlad, Nicolia Josuttis 2017-06-19 2017-06 P0053R4 Library Evolution, Concurrency, Library  
P0059R4 A proposal to add a ring span to the standard library Guy Davidson, Arthur O'Dwyer 2017-06-18 2017-06 P0059R3 SG14, Library Evolution  
P0122R5 span: bounds-safe views for sequences of objects Neil MacIntosh 2017-06-17 2017-06 P0122R4 Library  
P0194R4 Static reflection Matúš Chochlík, Axel Naumann, David Sankel 2017-06-18 2017-06 P0194R3 SG7, Evolution  
P0196R3 Generic none() factories for Nullable types Vicente J. Botet Escriba 2017-06-15 2017-06 P0196R2 Library Evolution  
P0208R1 Copy-swap Transaction Pablo Halpern 2017-06-17 2017-06 P0208R0 Library Evolution  
P0214R4 Data-Parallel Vector Types & Operations Matthias Kretz 2017-06-19 2017-06 P0214R3 Library Evolution  
P0233R4 Hazard Pointers: Safe Reclamation for Optimistic Concurrency Maged M. Michael, Michael Wong, Paul McKenney, Arthur O'Dwyer, David Hollman, Geoffrey Romer, Andrew Hunter 2017-06-18 2017-06 P0233R3 Concurrency, SG14, Library Evolution  
P0237r7 Wording for fundamental bit manipulation utilities Vincent Reverdy, Robert J. Brunner 2017-06-19 2017-06 P0237r6 Library Evolution  
P0238R1 Return type deduction and SFINAE Tomasz Kami_ski 2017-05-08 2017-06 P0238R0 Evolution  
P0244R2 Text_view: A C++ concepts and range based character encoding and code point enumeration library Tom Honermann 2017-06-13 2017-06 P0244R1 Library Evolution  
P0267R5 A Proposal to Add 2D Graphics Rendering and Display to C++, Michael McLaughlin, Herb Sutter, Jason Zink, Guy Davidson 2017-06-19 2017-06 P0267R4 Library Evolution  
P0306R3 Comma elision and comma deletion Thomas Koeppe 2017-06-18 2017-06 P0306R2 Evolution, Core, WG14  
P0312R1 Make Pointers to Members Callable Barry Revzin 2017-06-07 2017-06 P0312R0 Evolution  
P0315R2 Lambdas in unevaluated context Louis Dionne 2017-06-18 2017-06 P0315R1 Evolution  
P0319R1 Adding Emplace functions for promise<T>/future<T> Vicente J. Botet Escriba 2017-06-15 2017-06 P0319R0 Library Evolution, Concurrency  
P0323R2 A proposal to add a utility class to represent expected object (Revision 4) Vicente J. Botet Escriba 2017-06-15 2017-06 P0323R1 Library Evolution  
P0327R2 Product types access Vicente J. Botet Escriba 2017-06-15 2017-06 P0327R1 Evolution, SG7, Library Evolution  
P0329R3 Designated Initialization Wording Tim Shen, Richard Smith 2017-06-06 2017-06 P0329R2 Core  
P0338R2 C++ generic factories Vicente J. Botet Escriba 2017-06-15 2017-06 P0338R1 Library Evolution  
P0339R3 polymorphic_allocator<void> as a vocabulary type Pablo Halpern, Dietmar Kühl 2017-05-29 2017-06 P0339R2 Library Evolution  
P0343R1 Meta-programming High-Order Functions Vicente J. Botet Escriba 2017-06-15 2017-06 P0343R0 Library Evolution  
P0355R3 Extending <code><chrono></code> to Calendars and Time Zones Howard Hinnant 2017-06-18 2017-06 P0355R2 Library Evolution  
P0407R1 Allocator-aware basic stringbuf Peter Sommerlad 2017-06-15 2017-06 P0407R0 Library Evolution, Library  
P0408R2 Efficient Access to basic stringbuf's Buffer Peter Sommerlad 2017-06-07 2017-06 P0408R1 Library Evolution, Library  
P0425R0 Metaprogramming by design, not by accident Louis Dionne 2017-06-18 2017-06   SG7  
P0428R1 Familiar template syntax for generic lambdas Louis Dionne 2017-05-16 2017-06 P0428R0 Core  
P0429R1 A Standard flat_map Zach Laine 2017-08-31 2017-06 P0429R0 Library, Library Evolution  
P0433R3 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library Mike Spertus, Walter E. Brown, Stephan T. Lavavej 2017-06-18 2017-06 P0433R2 Library Evolution, Library  
P0447R2 Introduction of std::colony to the standard library Patrice Roy, Guy Davidson, Matthew Bentley 2017-06-16 2017-06 P0447R1 Library Evolution, SG14  
P0448R1 A strstream replacement using span<charT> as Peter Sommerlad 2017-06-07 2017-06 P0448R0 Library Evolution, Library  
P0484R1 Enhancing Thread Constructor Attributes Patrice Roy, Billy Baker, Arthur O'Dwyer 2017-06-18 2017-06 P0484R0 Concurrency  
P0501R2 C++ Module TS Issues List Gabriel Dos Reis 2017-06-19 2017-06 P0501R1 Core, Evolution  
P0506R1 use string_view for library function parameters instead of const string & / const char * Peter Sommerlad 2017-06-06 2017-06 P0506R0 Library, Library Evolution  
P0514R1 Enhancing std::atomic_flag for waiting Olivier Giroux 2017-06-14 2017-06 P0514R0 Concurrency  
P0515R1 Consistent comparison Herb Sutter 2017-06-16 2017-06 P0515R0 Evolution, Library Evolution, Core, Library  
P0534R1 call/cc (call-with-current-continuation): A low-level API for stackful context switching Oliver Kowalke 2017-06-18 2017-06 P0534R0 Concurrency, Library Evolution  
P0539R1 A Proposal to add wide_int Template Class Igor Klevanets, Antony Polukhin 2017-06-05 2017-06 P0539R0 Numerics  
P0542R1 Support for contract based programming in C++ G. Dos Reis, J. D. Garcia, J. Lakos, A. Meredith, N. Myers, B. Stroustrup 2017-06-16 2017-06 P0542R0 Library Evolution  
P0547R1 Ranges TS: Assorted Object Concept Fixes Eric Niebler 2017-06-10 2017-06 P0547R0 Library  
P0549R1 Adjuncts to std::hash Walter E. Brown 2017-06-11 2017-06 P0549R0 Library Evolution  
P0550R1 Transformation Trait uncvref Walter E. Brown 2017-06-11 2017-06 P0550R0 Library Evolution  
P0561R1 RAII Interface for Deferred Reclamation Geoffrey Romer 2017-06-16 2017-06 P0561R0 Concurrency  
P0566R1 Proposed Wording for Concurrent Data Structures: Hazard Pointer and Read-Copy-Update (RCU) Michael Wong, Maged M. Michael, Paul McKenney, Geoffrey Romer, Andrew Hunter 2017-06-19 2017-06 P0566R0 Concurrency, SG14, Library Evolution, Library  
P0567R1 Asynchronous managed pointer for Heterogeneous computing Gordon Brown, Ruyman Reyes, Michael Wong 2017-06-19 2017-06 P0567R0 Concurrency, SG14  
P0572R1 bit_sizeof and bit_offsetof Alex Christensen 2017-06-01 2017-06 P0572R0 Evolution  
P0573R1 Abbreviated Lambdas for Fun and Profit Barry Revzin 2017-06-04 2017-06 P0573R0 Evolution  
P0578R1 Static Reflection in a Nutshell Matúš Chochlík, Axel Naumann, David Sankel 2017-06-18 2017-06 P0578R0 Library Evolution  
P0584R0 Module Interface and Preamble Gabriel Dos Reis 2017-06-19 2017-06   Evolution  
P0591R2 Utility functions to implement uses-allocator construction Pablo Halpern 2017-06-12 2017-06 P0591R1 Library Evolution  
P0602R1 variant and optional should propagate copy/move triviality Zhihao Yuan 2017-04-30 2017-06 P0602R0 Library Evolution  
P0616R0 de-pessimize legacy <numeric> algorithms with std::move Peter Sommerlad 2017-06-06 2017-06   Library Evolution, Library  
P0619R1 Reviewing Deprecated Facilities of C++17 for C++20 Alisdair Meredith, Stephan T. Lavavej, Tomasz Kamiński 2017-03-19 2017-06 P0619R0 Evolution, Library Evolution  
P0627R1 Attribute to mark unreachable code Melissa Mears 2017-06-12 2017-06 P0627R0 Evolution  
P0635R0 Add c_array method to std::array Dan Raviv 2017-06-09 2017-06   Library Evolution  
P0636R0 Changes between C++14 and C++17 Thomas Köppe 2017-04-02 2017-06   All  
P0636R1 Changes between C++14 and C++17 Thomas Köppe 2017-06-18 2017-06 P0636R0 All  
P0637R0 Capture *this with initialize Thomas Köppe 2017-06-18 2017-06   Evolution  
P0638R0 Crochemore-Perrin search algorithm for std::search Ed Schouten 2017-05-03 2017-06   Library  
P0639R0 Changing attack vector of the constexpr_vector Antony Polukhin, Alexander Zaitsev 2017-06-14 2017-06   Evolution, Library Evolution  
P0640R0 User-defined exception information and diagnostic information in exception objects Emil Dotchevski, Peter Dimov 2017-04-15 2017-06   Library Evolution  
P0641R0 Resolving Core Issue #1331 (const mismatch with defaulted copy constructor) Daniel Krugler, Botond Ballo 2017-04-17 2017-06   Evolution  
P0642R0 Structural Support for C++ Concurrency Mingxin Wang 2017-05-26 2017-06   Concurrency, SG8, Evolution, Library Evolution  
P0644R0 Forward without forward Barry Revzin 2017-06-11 2017-06   Evolution  
P0645R0 Text Formatting Victor Zverovich 2017-05-22 2017-06   Library Evolution  
P0646R0 Improving the Return Value of Erase-Like Algorithms Marc Mutz 2017-05-19 2017-06   Library Evolution  
P0647R0 Floating point value access for std::ratio Peter Sommerlad 2017-05-20 2017-06   Library, Library Evolution  
P0648R0 Extending Tuple-like algorithms to Product-Typ Vicente J. Botet Escriba 2017-06-15 2017-06   SG7, Library Evolution  
P0650R0 C++ Monadic interface Vicente J. Botet Escriba 2017-06-15 2017-06   Library Evolution  
P0651R0 Switch the Ranges TS to Use Variable Concepts Eric Niebler 2017-06-17 2017-06   Library  
P0652R0 Concurrent associative data structure with unsynchronized view Anton Malakhov, Sergey Murylev, Antony Polukhin 2017-06-14 2017-06   Concurrency  
P0653R0 pointer_traits utility to convert to raw pointer Glen Joseph Fernandes 2017-05-28 2017-06   Library Evolution  
P0654R0 Explicit struct Loic Joly 2017-06-05 2017-06   Evolution  
P0656R0 Reducing <ratio> Walter Brown 2017-06-11 2017-06   Numerics, Library Evolution  
P0657R0 Deprecate Certain Declarations in the Global Namespace Walter Brown 2017-06-11 2017-06   Library Evolution  
P0658R0 Proposal for adding alias declarations to concepts Christopher Di Bella 2017-06-11 2017-06   Evolution  
P0659R0 Adding status() to std::future Nicolai Josuttis 2017-03-02 2017-06   Concurrency, Library  
P0660R0 A Cooperatively Interruptible Joining Thread Nicolai Josuttis 2017-06-19 2017-06   Concurrency, Library  
P0661R0 slot_map Container in C++ Allan Deutsch 2017-06-12 2017-06   Library Evolution, SG14  
P0662R0 Wording for Ranges TS Issue 345 / US-2: Update ranged-for-loop wording Casey Carter, Eric Niebler 2017-06-13 2017-06      
P0663R0 Ranges TS "Ready" Issues for the July 2017 (Toronto) meeting Casey Carter 2017-06-19 2017-06      
P0664R0 Coroutines TS Issues Gor Nishanov 2017-06-18 2017-06   Evolution, Core, Library  
P0665R0 Allowing Class Template Specializations in Unrelated Namespaces Tristan Brindle 2017-06-18 2017-06   Evolution  
P0666R0 C++ Latches and Barriers Alasdair Mackintosh 2017-06-19 2017-06   WG21  
P0667R0 The future of std::future extensions Hans-J. Boehm 2017-06-18 2017-06   Concurrency, Library Evolution  
P0668R0 Revising the C++ memory model Hans-J. Boehm, Olivier Giroux, Viktor Vafeiades 2017-06-19 2017-06   Concurrency  
P0669R0 Why We Should Standardize 2D Graphics for C++ Guy Davidson, Michael B. McLaughlin 2017-06-19 2017-06   Library Evolution  
P0670R0 Static reflection of functions Matúš Chochlík, Axel Naumann, David Sankel 2017-06-18 2017-06   SG7, Evolution, Library Evolution  
P0671R0 Parametric Functions Axel Naumann 2017-06-15 2017-06   Evolution  
P0672R0 Implicit Evaluation of "auto" Variables Joël Falcou, Peter Gottschling, Herb Sutter 2017-06-18 2017-06 N4035 Evolution  
P0673R0 Merge Concurrency TS atomic pointers into C++20 working draft Herb Sutter 2017-06-16 2017-06   WG21  
P0674R0 Extending make_shared to Support Arrays Peter Dimov, Glen Fernandes 2017-06-15 2017-06 N3939 Library Evolution  
P0675R0 Numeric Traits for Type Composition John McFarlane 2017-06-19 2017-06   Numerics, SG14, Library Evolution  
P0676R0 Towards a Good Future Felix Petriconi, David Sankel, Sean Parent 2017-06-18 2017-06   Library  
P0678R0 Business Requrements for Modules John Lakos 2017-06-16 2017-06   Evolution  
P0679R0 Forward progress vs. futures and continuations Torvald Riegel 2017-06-14 2017-06   Concurrency  
P0680R0 SG1 efficiency Torvald Riegel 2017-06-14 2017-06   Concurrency  
P0681R0 Precise Semantics for Assertions Lisa Lippincot 2017-06-16 2017-06   Evolution  
P0682R0 Repairing elementary string conversions Jens Maurer 2017-06-19 2017-06   Library Evolution, Library  
P0683R0 Default member initializers for bit-fields Jens Maurer 2017-06-18 2017-06   Evolution, Core  
P0684R0 C++ Stability, Velocity, and Deployment Plans Titus Winters, Bjarne Stroustrup, Daveed Vandevoorde, Beman Dawes, Michael Wong, Howard Hinnant 2017-06-19 2017-06   WG21  
P0685R0 SG5: Transactional Memory (TM) Meeting Minutes 2017/01/30-2017/06/05 Michael Wong 2017-06-19 2017-06   SG5  
P0686R0 SG14: Low Latency Meeting Minutes 2017/03/09-2017/06/14 Michael Wong 2017-06-19 2017-06   SG14  
P0687R0 Data Movement in C++ Ruyman Reyes, Gordon Brown, Michael Wong, Hartmut Kaiser 2017-05-30 2017-06   SG14, Concurrency  
P0688R0 A Proposal to Simplify the Unified Executors Design Chris Kohlhoff, Jared Hoberock, Chris Mysen, Gordon Brown 2017-06-19 2017-06   Concurrency  
P0689R0 A Word about Modules Gabriel Dos Reis 2017-06-19 2017-06   WG21  
P0690R0 Tearable Atomics JF Bastien, Billy Robert O'Neal III 2017-06-18 2017-06   Concurrency  
P0691R0 Integrating Concepts: "Open" items for consideration John H. Spicer, Hubert S.K. Tong, Daveed Vandevoorde 2017-06-17 2017-06   Evolution  
P0694R0 Function declarations using concepts Bjarne Stroustrup 2017-06-18 2017-06   WG21  
P0695R0 Alternative concepts Bjarne Stroustrup 2017-02-19 2017-06   Evolution  
P0696R0 Remove abbreviated functions and template-introduction syntax from the Concepts TS Tom Honermann 2017-06-19 2017-06   Evolution  
P0697R0 Clarifying the status of feature test macros Herb Sutter 2017-06-18 2017-06   Evolution, WG21  
P0698R0 C++ Standard Library Issues to be moved in Toronto Marshal Clow 2017-06-19 2017-06      
P0700R0 Alternatives to operator dot Bjarne Stroustrup 2017-02-21 2017-06   Evolution  
P0701R0 Back to the std2::future Bryce Adelstein Lelbach 2017-06-18 2017-06   Concurrency  
P0702R0 Language support for Constructor Template Argument Deduction Mike Spertus 2017-06-18 2017-06   Evolution, Core  
P0703R0 Networking TS Issues David Sankel 2017-06-18 2017-06   Library Evolution  
P0704R0 Fixing const-qualified pointers to members Barry Revzin 2017-06-18 2017-06   Evolution  
P0705R0 Implicit and Explicit conversions Tony Van Eerd 2017-06-19 2017-06   Library Evolution  
P0706R0 Efficient headers for modules (or not) S. Davis Herring 2017-06-18 2017-06   Evolution  
P0707R0 Metaclasses Herb Sutter 2017-06-18 2017-06   SG7  
P0710R0 Core Language Working Group "ready" Issues for the July, 2017 (Toronto) meeting William M. Miller 2017-06-19 2017-06      
P0711R0 Core Language Working Group "tentatively ready" Issues for the July, 2017 (Toronto) meeting William M. Miller 2017-06-19 2017-06      
P0712R0 Implementing language support for compile-time programming Andrew Sutton, Herb Sutter 2017-06-18 2017-06   SG7  
P0713R0 Identifying Module Source Code Daveed Vandevoorde 2017-06-18 2017-06   Evolution  
P0716R0 Unified concept definition syntax Richard Smith, Andrew Sutton 2017-06-19 2017-06   Evolution  
P0717R0 Semantic constraint matching for concepts Richard Smith, Andrew Sutton 2017-06-19 2017-06   Evolution  
P0718R0 Revising atomic_shared_ptr for C++20 Alisdair Meredith 2017-06-19 2017-06   Concurrency, Library Evolution, Library  
P0721R0 Exporting Using Declarations Nathan Sidwell 2017-06-20 2017-06   Evolution, Core  
P0722R0 Controlling destruction in delete expressions Richard Smith 2017-06-20 2017-06   Evolution  
P0723R0 Response to "Clarifying the status of feature test macros" Clark Nelson, John Spicer 2017-06-22 2017-06   Evolution,WG21  


Why typename?—Everything Cpp

Why and how do we use typename?

Why typename?

by Everything Cpp

From the video:

Whether you've been using C++ for days or years, misunderstanding the usage of 'typename' can observably lead you through the 5 stages of grief. Unfortunately, all too often, 'acceptance' means just throwing the keyword around until the compiler stops correcting you. Good luck should you need to use the 'template' keyword in a similar fashion.

In this video, we explore just what 'typename' is used for, how you can avoid these errors, and the obnoxious exception to the rule that causes people to doubt their understanding.