December 2017

5 ways how unique_ptr enhances resource safety in your code -- Bartlomiej Filipek

Examples where unique_ptr shines:

5 ways how unique_ptr enhances resource safety in your code

by Bartlomiej Filipek

From the article:

While shared_ptr and weak_ptr are more complex, unique_ptr seems to be a perfect replacement for owning raw pointers. Not to mention is the fact that this pointer type is mostly a compile time “wrapper” and it cost almost nothing in the runtime.

C++Now 2018 Call For Submissions

The C++Now 2018 Call For Submissions is open. 

Call For Submissions

by C++Now

About the call:

We invite all members of the C++ community, including first time submitters, to submit session proposals to the 7th annual C++Now Conference: C++Now 2018 (Aspen CO, USA, May 6 – 11, 2018).

 

Your own type predicate--Andrzej KrzemieĊ„ski

A very detailled and complete article to start playing with template predicates!

Your own type predicate

by Andrzej Krzemieński

From the article:

In this post we will see how to define a type trait or a type predicate or a meta-function that would allow us to check at compile time whether a type exposes an interface that we need. That is, we want to check if a given type T has:

  • nested typename result_type,
  • static member function set_limit that takes one argument of type int,
  • member function get_result that returns type const result_type& and that is declared not to throw exceptions...

2017-11 post-Albuquerque mailing available

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

 

2017-11 post-Albuquerque
N4704 WG21 telecon meeting: Pre-Albuquerque Herb Sutter 2017-09-30 2017-11   WG21  
N4705 WG21 2017-10-27 Telecon Minutes Jonathan Wakely 2017-10-30 2017-11   WG21  
N4706 Working Draft, Technical Specification for C++ Extensions for Parallelism Version 2 Jared Hoberock 2017-11-22 2017-11 N4698 WG21  
N4707 Parallelism TS Editor's Report Jared Hoberock 2017-11-22 2017-11   WG21  
N4708 Responses to National Body Comments, ISO/IEC PDTS 19216, C++ Extensions for Networking Barry Hedquist 2017-11-24 2017-11   WG21  
N4709 WG21 2017-11 Albuquerque Minutes Jonathan Wakely 2017-11-26 2017-11   WG21  
N4710 PL22.16 2017-11 Albuquerque Minutes Jonathan Wakely 2017-11-26 2017-11   WG21  
N4711 Working Draft, C ++ Extensions for Networking Jonathan Wakely 2017-11-27 2017-11 N4656 WG21  
N4712 Networking TS - Editor's Report Jonathan Wakely 2017-11-27 2017-11   WG21  
N4713 Working Draft, Standard for Programming Language C++ Richard Smith 2017-11-27 2017-11 N4700 WG21  
N4714 Editors' Report -- Programming Languages -- C++ Richard Smith 2017-11-27 2017-11   WG21  
P0020r6 Floating Point Atomic H. Carter Edwards, Hans Boehm, Olivier Giroux, JF Bastien, James Reus 2017-11-10 2017-11 P0020R5 Library Evolution Adopted 2017-11
P0052r6 Generic Scope Guard and RAII Wrapper for the Standard Library Peter Sommerlad, Andrew L. Sandoval 2017-11-21 2017-11 P0052R5 Library  
P0053r7 C++ Synchronized Buffered Ostream Lawrence Crowl, Peter Sommerlad, Nicolai Josuttis, Pablo Halpern 2017-11-07 2017-11 P0053r6 Library Evolution, Library Adopted 2017-11
P0075R2 Template Library for Parallel For Loops Pablo Halpern, Clark Nelson, Arch D. Robison, Robert Geva 2017-11-09 2017-11 P0075R1 SG1 Adopted 2017-11
P0202R3 Add Constexpr Modifiers to Functions in <algorithm> and <utility> Headers Antony Polukhin 2017-11-09 2017-11 P0202R2 Library Adopted 2017-11
P0214r7 Data-Parallel Vector Types & Operations Matthias Kretz 2017-11-27 2017-11 P0214r6 Library  
P0315R4 Wording for lambdas in unevaluated contexts Louis Dionne, Hubert Tong 2017-11-10 2017-11 P0315R3 Core Adopted 2017-11
P0323R4 std::expected Vicente Botet, JF Bastien 2017-11-26 2017-11 P0323R3 Library  
P0356R3 Simplified partial function application Tomasz Kamiński 2017-11-09 2017-11 P0356R2 Library Evolution  
P0407R2 Allocator-aware basic_stringbuf Peter Sommerlad 2017-11-16 2017-11 P0407R1 Library Evolution, Library  
P0408R3 Efficient Access to basic_stringbuf's Buffer Peter Sommerlad 2017-11-16 2017-11 P0408R2 Library  
P0415R1 Constexpr for std::complex Antony Polukhin 2016-11-10 2017-11 P0415R0 Library Evolution Adopted 2017-11
P0424R2 String literals as non-type template parameters Louis Dionne, Hana Dusíková 2017-11-14 2017-11 P0424R1 Core  
P0429R3 A Standard flat_map Zach Laine 2016-08-31 2017-11 P0429R2 Library Evolution, Library  
P0443R4 A Unified Executors Proposal for C++ Jared Hoberock, Michael Garland, Chris Kohlhoff, Chris Mysen, Carter Edwards, Gordon Brown 2017-11-22 2017-11 P0443R3 SG1  
P0457R2 String Prefix and Suffix Checking Mikhail Maltsev 2017-11-11 2017-11 P0457R1 Library Adopted 2017-11
P0476R2 Bit-casting object representations JF Bastien 2017-11-10 2017-11 P0476R1 Library  
P0515R3 Consistent comparison Herb Sutter, Jens Maurer, Walter E. Brown 2017-11-10 2017-11 P0515R2 Evolution, Library Evolution, Core, Library Adopted 2017-11
P0542R2 Support for contract based programming in C++ G. Dos Reis, J. D. Garcia, J. Lakos, A. Meredith, N. Myers, B. Stroustrup 2017-11-26 2017-11 P0542R1 Evolution, Core  
P0553R2 Bit operations Jens Maurer 2017-11-23 2017-11 P0553R1 Library  
P0556R2 Integral power-of-2 operations Jens Maurer 2017-11-23 2017-11 P0556R1 Library  
P0561R3 An RAII Interface for Deferred Reclamation Geoff Romer, Andrew Hunter 2017-11-11 2017-11 P0561R2 SG1, Library  
P0588R1 Simplifying implicit lambda capture Richard Smith 2017-11-07 2017-11 P0588R0 Core Adopted 2017-11
P0600R1 [[nodiscard]] in the Library Nicolai Josuttis 2017-11-09 2017-11 P0600R0 Library Evolution, Library Adopted 2017-11
P0614R1 Range-based for statements with initializer Thomas Köppe 2017-11-06 2017-11 P0614R0 Core Adopted 2017-11
P0619R2 Reviewing Deprecated Facilities of C++17 for C++20 Alisdair Meredith, Stephan T. Lavavej, Tomasz Kamiński 2017-11-06 2017-11 P0619R1 Core, Library  
P0624R2 Default constructible and assignable stateless lambdas Louis Dionne 2017-11-10 2017-11 P0624R1 Core Adopted 2017-11
P0641R2 Resolving Core Issue #1331 (const mismatch with defaulted copy constructor) Daniel Krügler, Botond Ballo 2017-11-08 2017-11 P0641R1 Core Adopted 2017-11
P0653R2 Utility to convert a pointer to a raw pointer Glen Joseph Fernandes 2017-11-09 2017-11 P0653R1 Library Adopted 2017-11
P0692R1 Access Checking on Specializations Matt Calabrese 2017-11-10 2017-11 P0692R0 Core Adopted 2017-11
P0718R2 Revising atomic_shared_ptr for C++20 Alisdair Meredith 2017-11-10 2017-11 P0718R1 SG1, Library Evolution, Library Adopted 2017-11
P0722R2 Efficient sized delete for variable sized classes Richard Smith, Andrew Hunter 2017-11-27 2017-11 P0722R1 Core, Library  
P0754R1 <version> Alan Talbot 2017-11-27 2017-11 P0754R0 Library  
P0767R1 Deprecate POD Jens Maurer 2017-11-10 2017-11 P0767R0 Library Evolution, Core, Library Adopted 2017-11
P0768R1 Library Support for the Spaceship (Comparison) Operator Walter E. Brown 2017-11-10 2017-11 P0768R0 Library Evolution, Library  
P0776R1 Rebase the Parallelism TS onto the C++17 Standard Alisdair Meredith 2017-11-10 2017-11 P0776R0 Library Adopted 2017-11
P0777R1 Treating Unnecessary decay Walter E. Brown 2017-11-06 2017-11 P0777R0 Library Adopted 2017-11
P0780R1 Allow pack expansion in lambda init-capture Barry Revzin 2017-11-26 2017-11 P0780R0 Evolution  
P0789R1 Range Adaptors and Utilities Eric Niebler 2017-11-17 2017-11 P0789R0 Library Evolution  
P0799R1 Vulnerability descriptions for the programming language C++ Stephen Michel 2017-11-27 2017-11 P0799R0 SG12  
P0818R1 Core Language Working Group "tentatively ready" Issues for the November, 2017 (Albuquerque) meeting William M. Miller 2017-11-10 2017-11 P0818R0 Core Adopted 2017-11
P0820R1 Feedback on P0214r6 Tim Shen 2017-11-15 2017-11 P0820R0 SG1, Library Evolution  
P0822R0 C++ Modules Are a Tooling Opportunity Gabriel Dos Reis 2017-10-16 2017-11   Evolution  
P0840R1 Language support for empty objects Richard Smith 2017-11-27 2017-11 P0840R0 Core  
P0843R0 fixed_capacity_vector Gonzalo Brito Gadeschi 2017-10-15 2017-11   Library Evolution, Library  
P0845R0 Common Subset of C++03 and C++17: Binders Detlef Vollmann 2017-10-13 2017-11   Library Evolution, Library  
P0846R0 ADL and Function Templates that are not Visible John Spicer 2017-11-08 2017-11   Core Adopted 2017-11
P0848R0 Conditionally Trivial Special Member Functions Barry Revzin, Casey Carter 2017-11-12 2017-11   Evolution  
P0849R0 auto(x): DECAY_COPY in the language Zhihao Yuan 2017-11-02 2017-11   Evolution, Library Evolution  
P0851R0 simd<T> is neither a product type nor a container type Matthias Kretz 2017-11-06 2017-11   SG1, Library Evolution  
P0857R0 Wording for "functionality gaps in constraints" Thomas Köppe 2017-11-10 2017-11   Core Adopted 2017-11
P0858R0 Constexpr iterator requirements Antony Polukhin 2017-11-11 2017-11   Library Evolution, Library  
P0859R0 Core Issue 1581: When are constexpr member functions defined? Richard Smith 2017-11-09 2017-11   Core Adopted 2017-11
P0864R0 C++ Standard Library Issues Resolved Directly In Albuquerque Marshall Clow 2017-11-11 2017-11   Library Adopted 2017-11
P0867R0 'Module Interface' is Misleading Nathan Sidwell 2017-11-21 2017-11   Evolution  
P0868R0 Selected RCU Litmus Tests Paul E. McKenney, Alan Stern, Andrew Hunter 2017-11-20 2017-11   SG1  
P0870R0 A proposal for a type trait to detect narrowing conversions Giuseppe D'Angelo 2017-11-21 2017-11   Library Evolution  
P0872R0 Discussion Summary: Applying Concepts to the Standard Library Beman Dawes 2017-11-25 2017-11   Library Evolution, Library  
P0873R0 A plea for a consistent, terse and intuitive declaration syntax Corentin Jabot 2017-11-27 2017-11   SG8, Evolution  
P0874R0 Syntax to anonymously refer to the current declaration contexts Corentin Jabot 2017-11-20 2017-11   SG7, Evolution  
P0875R0 WG21 2017-11 Albuquerque Record of Discussion Jonathan Wakely 2017-11-26 2017-11   WG21  

CLion 2017.3 released with C++ support improvements, Valgrind Memcheck...--Anastasia Kazakova

A new version is here!

CLion 2017.3 released with C++ support improvements, Valgrind Memcheck, Boost.Test and much more

by Anastasia Kazakova

From the article:

This year’s third release of CLion managed to accomplish both missions – bring dozens of C++ language support fixes, and overhaul and integrate new tools like Boost.Test and Valgrind Memcheck. Besides, v2017.3 updates a number of bundled tools, provides a simpler and more flexible way to configure toolchains, and improves the UI for running/debugging your applications...

Quick Q: May a destructor be final?

Quick A: Yes, as any other virtual member function.

Recently on SO:

May a destructor be final?

May a C++ destructor be declared as final?

Yes.

And if so, does that prevent declaration of a derived class:

Yes, because the derived class would have to declare a destructor (either explicitly by you or implicitly by the compiler), and that destructor would be overriding a function declared final, which is ill-formed.

The rule is [class.virtual]/4:

If a virtual function f in some class B is marked with the virt-specifier final and in a class D derived from B a function D​::​f overrides B​::​f, the program is ill-formed.

It's the derivation itself that is ill-formed, it doesn't have to be used.

Is declaring a destructor to be final a workable idiom for indicating that a class is not intended to be used as a base class?

Effectively, but you should just mark the class final. It's quite a bit more explicit.

CppCast Episode 128: Clang Power Tools with Victor Ciura

Episode 128 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Victor Ciura from Caphyon to talk about bringing clang tidy magic to Visual Studio C++ Developers with Clang Power Tools.

CppCast Episode 128: Clang Power Tools with Victor Ciura

by Rob Irving and Jason Turner

About the interviewee:

Victor Ciura is a Senior Software Engineer at CAPHYON and Technical Lead on the Advanced Installer team. For over a decade, he designed and implemented several core components and libraries of Advanced Installer such as: IIS, Repackager, OS virtualization and others.

He’s a regular guest at Computer Science Department of his Alma Mater, University of Craiova, where he gives student lectures & workshops on “Using C++STL for Competitive Programming and Software Development”.

Currently, he spends most of his time working with his team on improving and extending the repackaging and virtualization technologies in Advanced Installer, helping clients migrate their Win32 desktop apps to the Windows Store (AppX).