Dragging C++ into the Modern era
Guy Davidson speaks about the proposed 2d API for C++
Dragging C++ into the Modern era
by Guy Davidson
September 13-19, Aurora, CO, USA
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Meeting C++ | Jan 12, 2018 09:14 AM | Tags: meetingcpp intermediate efficiency 2d api
Guy Davidson speaks about the proposed 2d API for C++
Dragging C++ into the Modern era
by Guy Davidson
By Adrien Hamelin | Jan 11, 2018 02:40 PM | Tags: intermediate
Quick A: Read the core guidelines
Recently on reddit:
() vs {} when constructing objects
If I know the type, I'll write {}. If the type is generic, I'll only write {} with zero parameters. Otherwise, I might construct an initializer_list I didn't intend to...
By Adrien Hamelin | Jan 10, 2018 02:48 PM | Tags: intermediate
A good sum up.
The Pimpl Pattern - what you should know
by Bartlomiej Filipek
From the article:
Have you ever used the pimpl idiom in your code? No matter what’s your answer read on
In this article I’d like to gather all the essential information regarding this dependency breaking technique. We’ll discuss the implementation (const issue, back pointer, fast impl), pros and cons, alternatives and also show examples where is it used. You’ll also see how modern C++ can change this pattern. Moreover, I hope you’ll help me and provide your examples...
By Adrien Hamelin | Jan 10, 2018 02:35 PM | Tags: intermediate c++11
How to measure time in C++?
Introduction to std::chrono
by Rachel Crawford
From the article:
How many times have you tried to call a function that alleges to return a time value only to realise you don’t know what units the value is in? Or that takes a time value as a parameter, but doesn’t specify whether the value is expected to be in milliseconds, seconds, or hours?
By Adrien Hamelin | Jan 8, 2018 12:26 PM | Tags: intermediate
Quick A: undefined behaviour can result in anything.
Recently on SO:
Function not called in code gets called at runtime
The program contains undefined behavior, as dereferencing a null pointer (i.e. calling foo() in main without assigning a valid address to it beforehand) is UB, therefore no requirements are imposed by the standard.
Executing never_called at runtime is a perfect valid situation when undefined behavior has been hit, it's as valid as just crashing (like when compiled with GCC). Okay, but why is Clang doing that? If you compile it with optimizations off, the program will no longer output "formatting hard disk drive", and will just crash...
By Jason Turner | Jan 1, 2018 03:39 PM | Tags: intermediate efficiency c++17 advanced
Episode 96 of C++ Weekly.
Transparent Lambda Comparators
by Jason Turner
About the show:
In this episode Jason explores the use of lambdas as comparators for the associative containers. Just how far can we take the use of lambdas? Variadic templates, forwarding references, multiple inheritance, variadic "using" declarations, local classes, transparent comparators and direct base class initialization are all utilized in this video.
By Adrien Hamelin | Dec 27, 2017 10:46 AM | Tags: intermediate
Catch them all!
Exceptional fun!
by Glennan Carnie
From the article:
In this article I want to look at some applications for one of C++’s more obscure mechanisms, the function try-block...
By Adrien Hamelin | Dec 27, 2017 10:38 AM | Tags: intermediate c++11
To improve the error messages.
A friendly type predicate
by Andrzej Krzemieński
From the article:
This is a sequel to the previous post on writing a custom type predicate. One of the readers on Reddit made a very insightful observation. The user has implemented a type that she intends to use with our library, call it Calc. She passes it to the library function, and she gets the compiler error:
static assertion failed: X does not have a desired interfaceBut what is our type missing? In the previous post we were describing 3 constraints. A concept could have far more of them. The user has already made an effort to have Calc comply with the constraints, so there must be something tiny missing. Maybe there is a bug in the implementation of the predicate? But it is difficult to track what it is that the predicate does not like about our type. We could use some more specific information...
By Meeting C++ | Dec 23, 2017 06:39 AM | Tags: meetingcpp keynote intermediate efficiency community basics
The first keynote from Meeting C++ 2017 has been published:
Kate Gregory - It's Complicated - Meeting C++ 2017 Center Keynote
by Kate Gregory
By Adrien Hamelin | Dec 15, 2017 01:20 PM | Tags: intermediate
Some template tricks.
Mixin Classes: The Yang of the CRTP
by Jonathan Boccara
From the article:
Now that we’re clear on how the CRTP works, let me share with you another technique involving templates that is complementary to the CRTP: Mixin classes. I learnt about mixin classes by watching Arthur O’Dwyer’s Template Normal Programming talk at CppCon (actually you can find them in the slides because they were skipped over during the presentation)...