C++ Weekly Episode 115: Compile Time ARM Emulator—Jason Turner

Episode 115 of C++ Weekly.

Compile Time ARM Emulator

by Jason Turner

About the show:

This episode of C++ Weekly demonstrates a compile time ARM CPU emulator using C++17 constexpr. No special tricks were necessary to accomplish this feat, merely following a rule of "constexpr everything that is reasonable." The code is portable and currently compiles with GCC and Clang in about 2 seconds for simple compile-time test cases.

Using C++17 std::optional—Bartlomiej Filipek

See how and when std::optional from C++17 is useful:<img alt="" data-cke-saved-src="https://dl.dropboxusercontent.com/s/nv9s71vz8kq8pq3/stdoptusing.png?dl=0" src="https://dl.dropboxusercontent.com/s/nv9s71vz8kq8pq3/stdoptusing.png?dl=0" 400px;="" height:="" 128px;="" float:="" right;"="" style="height: 74px; width: 230px; float: right;">

Using C++17 std::optional

by Bartlomiej Filipek

From the article:

By adding the boolean flag to other types, you can achieve a thing called “nullable types”. As mentioned, the flag is used to indicate whether the value is available or not. Such wrapper represents an object that might be empty in an expressive way (so not via comments smile)

2018-05 pre-Rapperswil mailing available

The full 2018-05 mailing of new standards papers is now available.

 

WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup Disposition
SD-1 2018 PL22.16/WG21 document list Hal Finkel 2018-05-07 2018-05
2018-05 pre-Rapperswil
N4745 PL22.16/WG21 draft agenda: 4-9 June 2018, Rapperswil, Switzerland John Spicer 2018-04-30 2018-05 WG21
N4746 Working Draft, C++ Extensions for Reflection David Sankel 2018-05-07 2018-05 WG21
N4747 Reflection TS - Editor’s Report David Sankel 2017-05-05 2018-05 WG21
N4748 WG21 telecon meeting: Pre-Rapperswil Herb Sutter 2018-05-06 2018-05 WG21
N4749 Editors' Report - Programming Languages - C++ Richard Smith, Dawn Perchik, Thomas Köppe 2018-04-04 2018-05 WG21
N4750 Working Draft, Standard for Programming Language C++ Richard Smith 2018-05-07 2018-05 N4741 WG21
P0009r6 mdspan: A Non-Owning Multidimensional Array Reference H. Carter Edwards, Bryce Adelstein Lelbach, Daniel Sunderland, David Hollman, Christian Trott, Mauro Bianco, Ben Sander, Athanasios Iliopoulos, John Michopoulos, Daniel Sunderland 2018-05-07 2018-05 P0009R5 Library
P0019r7 Atomic Ref H. Carter Edwards, Hans Boehm, Olivier Giroux, Daniel Sunderland, Mark Hoemmen, David Hollman, Bryce Adelstein Lelbach, Jens Maurer 2018-05-06 2018-05 P0019r6 SG1, Library
P0037R5 Fixed-Point Real Numbers John McFarlane 2018-05-07 2018-05 P0037R4 SG6, SG14, Library Evolution
P0052r8 Generic Scope Guard and RAII Wrapper for the Standard Library Peter Sommerlad, Andrew L. Sandoval 2018-04-24 2018-05 P0052r7 Library
P0124R5 Linux-Kernel Memory Model Paul E. McKenney, Ulrich Weigand, Andrea Parri, Boqun Feng 2018-04-06 2018-05 P0124R4 SG1
P0132R1 Non-throwing container operations Ville Voutilainen 2018-05-07 2018-05 P0132R0 Evolution
P0196R5 Generic none() factories for Nullable types Vicente J. Botet Escribá 2018-05-03 2018-05 P0196R4 Library Evolution
P0319R2 Adding Emplace functions for promise<T>/future<T> (revision 2) Vicente J. Botet Escribá 2018-05-03 2018-05 P0319R1 SG1, Library Evolution
P0340R1 Making std::underlying_type SFINAE-friendly R. "Tim" Song 2018-05-07 2018-05 P0340R0 Library Evolution, Library
P0408R4 Efficient Access to basic_stringbuf’s Buffer Peter Sommerlad 2018-05-01 2018-05 P0408R3 Library
P0429R4 A Standard flatmap Zach Laine 2018-05-05 2018-05 P0429R3 Library
P0443r7 A Unified Executors Proposal for C++ Jared Hoberock, Michael Garland, Chris Kohlhoff, Chris Mysen, H. Carter Edwards, Gordon Brown 2018-05-07 2018-05 P0443r6 SG1, Library Evolution
P0482R3 char8_t: A type for UTF-8 characters and strings (Revision 3) Tom Honermann 2018-05-07 2018-05 P0482R2 Evolution, Library Evolution
P0514R4 Efficient concurrent waiting for C++20 Olivier Giroux 2018-05-03 2018-05 P0514R3 Library Evolution
P0527R1 Implicitly move from rvalue references in return statements David Stone 2017-11-08 2018-05 P0527R0 Core
P0539R4 A Proposal to add wide_int Template Class Igor Klevanets, Antony Polukhin 2018-05-03 2018-05 P0539R3 SG6, Library Evolution
P0540R1 A Proposal to Add split/join of string/string_view to the Standard Library Laurent NAVARRO 2018-04-29 2018-05 P0540R0 Library Evolution
P0566R5 Proposed Wording for Concurrent Data Structures: Hazard Pointer and Read­Copy­Update (RCU) Michael Wong, Maged M. Michael, Paul McKenney, Geoffrey Romer, Andrew Hunter, Arthur O'Dwyer, David S. Hollman, JF Bastien, Hans Boehm, David Goldblatt, Frank Birbacher 2018-05-06 2018-05 P0566R4 SG1, SG14, Library Evolution, Library
P0572R2 Static reflection of bit fields Alex Christensen 2018-05-06 2018-05 P0572R1 SG7
P0595R1 std::is_constant_evaluated() Richard Smith, Andrew Sutton, Daveed Vandevoorde 2018-05-04 2018-05 P0595R0 Evolution, Library Evolution
P0619R3 Reviewing Deprecated Facilities of C++17 for C++20 Alisdair Meredith, Stephan T. Lavavej, Tomasz Kamiński 2018-05-07 2018-05 P0619R2 Core, Library
P0645R2 Text Formatting Victor Zverovich 2018-04-28 2018-05 P0645R1 Library Evolution, Library
P0660R2 A Cooperatively Interruptible Joining Thread, Rev 2 Nicolai Josuttis, Herb Sutter, Anthony Williams 2018-05-07 2018-05 P0660R1 SG1, Library Evolution, Library
P0664R3 C++ Coroutine TS Issues Gor Nishanov 2018-05-05 2018-05 P0664R2 Evolution, Core, Library Evolution
P0665R1 Allowing Class Template Specializations in Associated Namespaces (revision 1) Tristan Brindle 2018-05-06 2018-05 P0665R0 Evolution
P0666R2 Revised Latches and Barriers for C++20 Olivier Giroux 2018-05-06 2018-05 P0666R1 SG1
P0668R3 Revising the C++ memory model Hans-J. Boehm, Olivier Giroux, Viktor Vafeiades 2018-05-05 2018-05 P0668R2 SG1
P0670R3 Function reflection Matúš Chochlík, Axel Naumann, David Sankel 2018-05-07 2018-05 P0670R2 Core, Library
P0671R2 Self-explanatory Function Arguments Axel Naumann 2018-05-07 2018-05 P0671R1 Evolution
P0709R0 Zero-overhead deterministic exceptions: Throwing values Herb Sutter 2018-05-02 2018-05 SG14
P0736R1 Nameless parameters and unutterable specializations Hubert S.K. Tong 2018-05-05 2018-05 P0736R0 Evolution
P0745R1 Concepts in-place syntax Herb Sutter 2018-04-29 2018-05 P0745R0 Evolution, Core
P0769R1 Add shift to <algorithm> Dan Raviv 2018-02-05 2018-05 P0769R0 Library
P0772R1 Execution Agent Local Storage Nat Goodspeed, Michael Wong, Paul McKenney, Jared Hoberock, H. Carter Edwards, Tony Tye, Alex Voicu, Gordon Brown, Mark Hoemmen 2018-05-07 2018-05 P0772R0 SG1
P0784R2 Standard containers and constexpr Louis Dionne, Richard Smith, Nina Ranns, Daveed Vandevoorde 2018-05-05 2018-05 P0784R1 Evolution, Library Evolution
P0784R3 More constexpr containers Louis Dionne, Richard Smith, Nina Ranns, Daveed Vandevoorde 2018-05-04 2018-05 P0784R2 Evolution, Library Evolution
P0788R2 Standard Library Specification in a Concepts and Contracts World Walter E. Brown 2018-05-05 2018-05 P0788R1 Library
P0789R3 Range Adaptors and Utilities Eric Niebler 2018-05-06 2018-05 P0789R2 Library
P0792R2 function_ref: a non-owning reference to a Callable Vittorio Romeo 2018-05-06 2018-05 P0792R1 Library Evolution
P0796R2 Supporting Heterogeneous & Distributed Computing Through Affinity Gordon Brown, Ruyman Reyes, Michael Wong, H. Carter Edwards, Thomas Rodgers, Mark Hoemmen 2018-05-07 2018-05 P0796R1 SG1, SG14
P0829R2 Freestanding Proposal Ben Craig 2017-10-14 2018-05 P0829R1 SG14, Library Evolution
P0836R1 Introduce Parallelism to the Ranges TS Gordon Brown, Christopher Di Bella, Michael Haidl, Toomas Remmelg, Ruyman Reyes, Michel Steuwer, Michael Wong 2018-05-07 2018-05 P0836R0 SG1, SG9, SG14, Library Evolution
P0844R0 Type functions and beyond J. Monnon 2018-02-26 2018-05 SG7, SG8, Evolution
P0860R1 Atomic Access Property for mdspan Dan Sunderland, Christian Trott, H. Carter Edwards 2018-05-06 2018-05 P0860R0 SG1, Library Evolution
P0868R2 Selected RCU Litmus Tests Paul E. McKenney, Alan Stern, Andrew Hunter, Jade Alglave, Luc Maranget 2018-02-09 2018-05 P0868R1 SG1
P0876R2 fiber_context - fibers without scheduler Oliver Kowalke, Nat Goodspeed 2018-05-06 2018-05 P0876R1 SG1
P0880R1 Numbers interaction Igor Klevanets, Antony Polukhin 2018-05-04 2018-05 P0880R0 SG6, Library Evolution
P0881R1 A Proposal to add stack trace library Alexey Gorgurov, Antony Polukhin 2018-04-19 2018-05 P0881R0 Library Evolution
P0892R1 explicit(bool) Barry Revzin, Stephan T. Lavavej 2018-03-30 2018-05 P0892R0 Evolution
P0893R1 Chaining Comparisons Barry Revzin, Herb Sutter 2018-04-28 2018-05 P0893R0 Evolution
P0894R0 `realloc()` for C++ Victor Dyachenko 2018-01-10 2018-05 Library Evolution
P0896R1 Merging the Ranges TS Eric Niebler, Casey Carter 2018-05-06 2018-05 P0896R0 Library Evolution, Library
P0898R2 Standard Library Concepts Casey Carter, Eric Niebler 2018-05-06 2018-05 P0898R1 Library
P0903R2 Define basic_string_view(nullptr) Ashley Hedberg, Titus Winters, Jorg Brown 2018-05-07 2018-05 P0903R1 Evolution, Library Evolution, Library
P0907R2 Signed Integers are Two’s Complement JF Bastien 2018-04-01 2018-05 P0907R1 Evolution
P0912R1 Merge Coroutines TS into C++20 working draft Gor Nishanov 2018-05-05 2018-05 P0912R0 WG21
P0917R1 Making operator?: overloadable Matthias Kretz 2018-05-06 2018-05 P0917R0 Evolution
P0921R2 Standard Library Compatibility Titus Winters, Ashley Hedberg 2018-05-06 2018-05 P0921R1 Evolution, Library Evolution
P0923R1 Modules:Dependent ADL Nathan Sidwell 2018-05-04 2018-05 P0923R0 Evolution
P0933R0 Runtime type introspection with std::exception ptr Aaryaman Sagar 2018-02-07 2018-05 Library Evolution
P0940R1 Concurrency TS is growing: Concurrent Utilities and Data Structures Michael Wong, Olivier Giroux 2018-05-07 2018-05 P0940R0 SG1, Library Evolution, Library
P0941R1 Integrating feature-test macros into the C++ WD Ville Voutilainen 2018-05-04 2018-05 P0941R0 Evolution, Library Evolution
P0957R1 PFA: A Generic, Extendable and Efficient Solution for Polymorphic Programming Mingxin Wang 2018-04-18 2018-05 P0957R0 SG7, SG9, Evolution, Core, Library Evolution, Library
P0958R1 Networking TS changes to support proposed Executors TS Christopher Kohlhoff 2018-05-06 2018-05 P0958R0 SG1, Library Evolution
P0960R1 Allow initializing aggregates from a parenthesized list of values Ville Voutilainen 2018-05-02 2018-05 P0960R0 Evolution
P0964R1 Finding the right set of traits for simd<T> Matthias Kretz 2018-05-07 2018-05 P0964R0 Library Evolution
P0970R1 Better, Safer Range Access Customization Points Eric Niebler 2018-05-06 2018-05 P0970R0 Library Evolution
P0972R0 <chrono> zero(), min(), and max() should be noexcept Billy Robert O'Neal III 2018-02-28 2018-05 Library Evolution, Library
P0977R0 Remember the Vasa! Bjarne Stroustrup 2018-03-06 2018-05 WG21
P0988R0 Ruminations on 2D graphics in the C++ International Standard Guy Davidson 2018-04-30 2018-05 WG21
P1007R0 std::assume_aligned Timur Doumler, Chandler Carruth 2018-05-04 2018-05 Library Evolution, Library
P1008R0 Prohibit aggregate types with user-declared constructors Timur Doumler, Arthur O’Dwyer, Richard Smith, Howard E. Hinnant 2018-05-07 2018-05 Evolution, Core
P1010R0 Container support for implicit lifetime types Mark Zeren, Chris Kennelly 2018-05-06 2018-05 Library Evolution, Library
P1016R0 A few additional type manipulation utilities Vincent Reverdy 2018-05-06 2018-05 Library Evolution
P1017R0 Executors should be variadic Hartmut Kaiser, John Biddiscombe 2018-05-06 2018-05 SG1
P1019R0 Integrating Executors with Parallel Algorithms Jared Hoberock 2018-05-07 2018-05 SG1
P1020R0 Smart pointer creation with default initialization Glen Joseph Fernandes, Peter Dimov 2018-04-08 2018-05 Library Evolution
P1021R0 Extensions to Class Template Argument Deduction Mike Spertus 2018-05-07 2018-05 Evolution
P1022R0 Material for 2018 JAX Discussions of Hazard Pointer and Read-Copy-Update (RCU) Michael Wong, Maged M. Michael, Paul McKenney, Geoffrey Romer, Andrew Hunter, Arthur O'Dwyer, David S. Hollman, JF Bastien, Hans Boehm, David Goldblatt 2018-04-20 2018-05 SG1, SG14, Library Evolution, Library, Library
P1023R0 constexpr comparison operators for std::array Tristan Brindle 2018-05-06 2018-05 Library Evolution
P1024R0 Usability Enhancements for std::span Tristan Brindle 2018-05-06 2018-05 Library Evolution
P1025R0 Update The Reference To The Unicode Standard Steve Downey 2018-04-23 2018-05 SG16, Core, Library
P1026R0 A call for a Data Persistence (iostream v2) study group Niall Douglas 2018-05-06 2018-05 Library Evolution
P1028R0 SG14 status_code and standard error object for P0709 Zero-overhead deterministic exceptions Niall Douglas 2018-05-06 2018-05 Library Evolution
P1029R0 SG14 [[move_relocates]] Niall Douglas 2018-05-06 2018-05 Evolution
P1030R0 std::filesystem::path_view Niall Douglas 2018-05-06 2018-05 Library Evolution
P1031R0 Low level file i/o library Niall Douglas 2018-05-06 2018-05 Library Evolution
P1032R0 Misc constexpr bits Antony Polukhin 2018-05-03 2018-05 Library Evolution
P1033R0 Rangify the uninitialised memory algorithms! Casey Carter, Christopher Di Bella 2018-05-06 2018-05 Library Evolution
P1035R0 Input range adaptors Christopher Di Bella 2018-05-07 2018-05 Library Evolution
P1037R0 Deep Integration of the Ranges TS Eric Niebler, Casey Carter 2018-05-06 2018-05 Library Evolution
P1040R0 std::embed JeanHeyd Meneide 2018-05-07 2018-05 SG15, Evolution, Library Evolution
P1041R0 Make char16_t/char32_t string literals be UTF-16/32 Martinho Fernandes 2018-04-24 2018-05 Evolution
P1043R0 Narrow contracts in string_view versus P0903R1 Andrzej Krzemieński, Nevin Liber 2018-05-07 2018-05 Evolution, Library Evolution, Library
P1044R0 std::async() in an Executors World Thomas Rodgers, H. Carter Edwards, Mark Hoemmen 2018-05-04 2018-05 SG1, Library Evolution
P1045R0 constexpr Function Parameters David Stone 2018-04-29 2018-05 Evolution
P1046R0 Automatically Generate More Operators David Stone 2018-04-28 2018-05 Evolution
P1048R0 A proposal for a type trait to detect scoped enumerations Juan Alday 2018-05-01 2018-05 Library Evolution
P1050R0 Fractional Numeric Type John McFarlane 2018-05-07 2018-05 SG6, Library Evolution
P1051R0 std::experimental::expected LWG design issues Vicente J. Botet Escribá 2018-05-03 2018-05 Library Evolution
P1052R0 Modules, Macros, and Build Systems Boris Kolpackov 2018-05-02 2018-05 SG15, Evolution
P1053R0 Future-proofing continuations for executors Lee Howes, Eric Niebler 2018-05-06 2018-05 SG1, Library Evolution
P1054R0 A Unified Futures Proposal for C++ Lee Howes, Bryce Adelstein Lelbach, David S. Hollman, Michał Dominiak 2018-05-07 2018-05 SG1
P1055R0 A Modest Executor Proposal Kirk Shoop, Eric Niebler, Lee Howes 2018-04-26 2018-05 Library Evolution
P1056R0 Add coroutine task type Lewis Baker, Gor Nishanov 2018-05-05 2018-05 SG1
P1059R0 Adapting Asio to use std::expected Thomas Rodgers 2018-05-06 2018-05 Library Evolution
P1061R0 Structured Bindings can introduce a Pack Barry Revzin, Jonathan Wakely 2018-05-01 2018-05 Evolution
P1062R0 Diet Graphics Bryce Adelstein Lelbach, Olivier Giroux, Zach Laine, Corentin Jabot, Vittorio Romeo 2018-05-07 2018-05 WG21
P1063R0 Core Coroutines Geoff Romer, James Dennett, Chandler Carruth 2018-05-06 2018-05 Evolution
P1064R0 Allowing Virtual Function Calls in Constant Expressions Peter Dimov, Vassil Vassilev 2018-05-04 2018-05 Evolution
P1066R0 How to catch an exception_ptr without even try-ing Mathias Stearn 2018-05-07 2018-05 Evolution, Library Evolution
P1067R0 C++ Dependency Management: Package Consumption vs Development Boris Kolpackov 2018-05-04 2018-05 SG15
P1068R0 Vector API for random number generation Ilya Burylov, Alexey Kukanov, Ruslan Arutyunyan, Andrey Nikolaev, Pablo Halpern 2018-05-07 2018-05 SG1
P1070R0 SG5: Transactional Memory (TM) Meeting Minutes 2018/04/09 Michael Wong 2018-05-07 2018-05 SG5
P1071R0 SG14: Low Latency Meeting Minutes 2018/04/11- 2018/05/02 Michael Wong 2018-05-07 2018-05 SG14
P1072R0 Default Initialization for basic_string Chris Kennelly, Mark Zeren 2018-05-04 2018-05 SG16, Library Evolution, Library
P1073R0 constexpr! functions Richard Smith, Andrew Sutton, Daveed Vandevoorde 2018-05-04 2018-05 Evolution
P1074R0 CWG defect Defined Behavior of Invalid Pointers Maged Michael, David Goldblatt, Michael Wong, Paul McKenney 2018-05-07 2018-05 SG1, Core
P1076R0 Editorial clause reorganization Jens Maurer 2018-05-05 2018-05 Core, Library
P1077R0 Allowing Virtual Destructors to be “Trivial” Peter Dimov 2018-05-04 2018-05 Evolution
P1079R0 A minimal solution to the concepts syntax problems Bjarne Stroustrup 2018-05-06 2018-05 Evolution
P1080R0 SG16: Unicode meeting summaries 2018/03/28 - 2018/04/25 Tom Honermann 2018-05-06 2018-05 SG16
P1081R0 On empty structs in the standard library Vincent Reverdy, Collin Gress 2018-05-07 2018-05 Library Evolution
P1082R0 C++ Standard Library Issues to be moved in Rapperswil Marshall Clow 2018-05-06 2018-05 WG21
P1083R0 Move resource_adaptor from Library TS to the C++ WP Pablo Halpern 2018-05-06 2018-05 Library Evolution
P1084R0 Today's return-type-requirements Are Insufficient Walter E. Brown, Casey Carter 2018-05-06 2018-05 Evolution
P1085R0 Should Span be Regular? Tony Van Eerd 2018-05-04 2018-05 Evolution
P1086R0 Natural Syntax: Keep It Simple Gabriel Dos Reis 2018-05-07 2018-05 Evolution
P1087R0 Modules for Standard C++ Gabriel Dos Reis, Richard Smith 2018-05-07 2018-05 Evolution
P1089R0 Sizes Should Only span Unsigned Robert Douglas, Nevin Liber, Marshall Clow 2018-05-06 2018-05 Library Evolution
P1090R0 Aggregate initialization in the presence of deleted constructors Ville Voutilainen 2018-05-07 2018-05 Evolution
P1091R0 Extending structured bindings to be more like variable declarations Nicolas Lesser 2018-05-07 2018-05 Evolution
P1093R0 Is undefined behaviour preserved? Andrew Bennieston, Jonathan Coe, Daven Gahir, Thomas Russell 2018-05-07 2018-05 SG12, Evolution, Library Evolution
P1094R0 Nested Inline Namespaces Alisdair Meredith 2018-05-07 2018-05 Evolution

CppCast Episode 149: CppChat with Phil Nash

Episode 149 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Phil Nash to discuss the rebooted CppChat show, test driven development, a conference announcement and much more.

CppCast Episode 149: CppChat with Phil Nash

by Rob Irving and Jason Turner

About the interviewee:

Phil has spent the last year and a half doing things that might sound interesting for the next time he’s interviewed on CppCast. He might have overdone it. Aside from that he’s most commonly known as the original author of the test framework, Catch2. He’s been in or around C++ since the early 90s, but started coding in 1981 on a ZX-81 that he borrowed for six months. He’s worked in many domains, including finance and mobile and is now developer advocate for C++ and Swift tools at JetBrains.

Non-Ownership and Generic Programming and Regular types, oh my!==Barry Revzin

Do you know about it?

Non-Ownership and Generic Programming and Regular types, oh my!

by Barry Revzin

From the article:

This post is about a specific collection of types in the C++ core language and standard library. I am not sure of a good way to name this collection, and some terms that come to mind come with their own baggage, so I’m going to for now group them together under an umbrella that is clearly widely unrelated to programming and call them Westie types (because, like my dog, they are awesome yet enigmatic).

IO2D demo: CPULoad—Michael Kazakov

A walkthrough of the CPULoad demo from the 2D Graphics proposal:

IO2D demo: CPULoad

by Michael Kazakov

From the article:

In my humble opinion, the 2D graphics proposal might bring C++ a solid foundation for visualization support. It’s powerful enough to build complex structures on top of it – here I can refer to the sample SVG renderer as an example. At the same time, it’s not built around some particular low-level graphics API (i.e OpenGL/DirectX/Mantle/Metal/Vulkan), which come and go over time (who remembers Glide?). What is also very important about the proposal is its implementability – I wrote the CoreGraphics backend in ~3 months on a part-time basis. It can be assumed that writing a theoretical Direct2D backend might take about the same time. While it’s easy to propose “just” a support for PostScript, SVG or even HMTL5, the practical implementability of such extensive standards is very doubtful. Having said that, I do think that the proposal, while being a valid direction, is far from being perfect and needs a lot of polishing.

Quick Q: Undefined behavior and sequence points

Quick A: No quick A.

Recently on SO:

Undefined behavior and sequence points

What are "sequence points"?

What is the relation between undefined behaviour and sequence points?

I often use funny and convoluted expressions like a[++i] = i;, to make myself feel better. Why should I stop using them?

If you've read this, be sure to visit the follow-up question Undefined behavior and sequence points reloaded.

(Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want to critique the idea of providing an FAQ in this form, then the posting on meta that started all this would be the place to do that. Answers to that question are monitored in the C++ chatroom, where the FAQ idea started out in the first place, so your answer is very likely to get read by those who came up with the idea.)

Quick Update on C++ Compiler Bug Hunt—No Bugs” Hare

Looking for the bug.

Quick Update on C++ Compiler Bug Hunt

by No Bugs" Hare

From the article:

Some time ago, I wrote a post about kscope – mini-project on finding and reporting bugs in modern C++ compilers. The point was that there is a way to use C++ facilities to make C++ code self-mutating (more strictly – pseudo-randomized using externally supplied ITHARE_KSCOPE_SEED macro), which allows finding certain classes of bugs during randomized testing. In the previous post, I wrote about 12 bugs reported, with 3 of them already fixed. I have to admit that since that point, I didn’t have as much time as I’d like to spend on kscope; still, 3 more bugs were reported (2 of them being codegen bugs) – and quite a few were fixed (fortunately, bugfixing is one thing which doesn’t require my participation <wink />)...

Using C++17 std::optional—Bartlomiej Filipek

A reminder.

Using C++17 std::optional

by Bartlomiej Filipek

From the article:

Let’s take a pair of two types <YourType, bool> - what can you do with such composition?

In this article, I’ll describe std:optional - a new helper type added in C++17. It’s a wrapper for your type and a flag that indicates if the value is initialized or not. Let’s see where it can be useful and how you can use it.