Is std::for_each obsolete?--Jonathan Boccara
Do you agree?
Is std::for_each obsolete?
by Jonathan Boccara
From the article:
Today we explore a question about std::for_each. Enjoy the reading!
June 16-21, Sofia, Bulgaria
September 13-19, Aurora, CO, USA
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 16-21, Kona, HI, USA
By Adrien Hamelin | Apr 4, 2018 03:14 PM | Tags: intermediate c++11
Do you agree?
Is std::for_each obsolete?
by Jonathan Boccara
From the article:
Today we explore a question about std::for_each. Enjoy the reading!
By Adrien Hamelin | Apr 4, 2018 03:12 PM | Tags: intermediate c++17
What do you think?
std::string_view is a borrow type
by Arthur O’Dwyer
From the article:
Today I’d like to talk about std::string_view. string_view arrived in C++17, amid quite a bit of confusion about what exactly it’s for and how to use it safely...
By Adrien Hamelin | Apr 3, 2018 02:01 PM | Tags: performance intermediate c++17
Be careful.
Using Parallel <algorithm> Without a Clue: 90x Performance Loss Instead of 8x Gain
by "No Bugs" Hare
From the article:
With C++17 supporting1 parallel versions of the std:: algorithms, there are quite a few people saying “hey, it became really simple to write parallel code!”.
Just as one example, [MSDN] wrote: “Only a few years ago, writing parallel code in C++ was a domain of the experts.” (implying that these days, to write parallel code, you don’t need to be an expert anymore).
Inquisitive hare:
“I made an experiment which demonstrates Big Fat Dangers(tm) of implying that parallelization can be made as simple as just adding a policy parameter to your std:: call.
I always had my extremely strong suspicions about this position being deadly wrong, but recently I made an experiment which demonstrates Big Fat Dangers(tm) of implying that parallelization can be made as simple as just adding a policy parameter to your std:: call...
By Adrien Hamelin | Mar 14, 2018 12:13 PM | Tags: intermediate
A tough problem.
String’s competing constructors
by Andrzej Krzemieński
From the article:
Let’s start with the problem. I want to check whether a program received a text message that consists of four consecutive zeroes. Not '0', but the numeric zero. I will create a constant std::string representing the special sequence and compare the messages (also stored as std::strings) I receive...
By Adrien Hamelin | Mar 12, 2018 12:23 PM | Tags: intermediate community
A very interesting article that we should all read.
A Foolish Consistency
by Jon Kalb
From the article:
Ralph Waldo Emerson famously said, “A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines.” I don’t think he was talking about code, but that statement couldn’t be more relevant to software engineers.
I’ve experienced a scenario like this a number of time in my career:
I’m sharing a new approach to writing code that offers some clear improvements to what we’ve been doing. Perhaps it is more readable, more efficient, or safer. But the response that I hear from colleagues is, “But we can’t do that here. We have <some large number> lines of code where we didn’t do it that way, so it wouldn’t be consistent.”
By Meeting C++ | Feb 27, 2018 07:26 AM | Tags: meetingcpp intermediate boost advanced
Learn from Boris Schäling on how to implement the factory pattern in Modern C++:
The hidden rules of world-class C++ code
by Boris Schäling
By Meeting C++ | Feb 26, 2018 08:24 AM | Tags: meetingcpp intermediate
Klaus Iglberger tries to convince you of giving free functions a try:
Free your functions!
by Klaus Iglberger
By Meeting C++ | Feb 23, 2018 07:39 AM | Tags: meetingcpp intermediate
Kevlin Henney giving a talk at Meeting C++ 2017!
Declarative thinking, declarative practice
by Kevlin Henney
By Adrien Hamelin | Feb 20, 2018 08:44 AM | Tags: intermediate
Quick A: Yes, and there are no ambiguity with static members.
Recently on SO:
In C++ are static member functions inherited? If yes why ambiguity error does not arise?
It's fine according to the lookup rules. You see, when you write member access (obj.display();), the member display is looked up not just in the scope of the class and its base classes. Base class sub-objects are taken into consideration as well.
If the member being looked up is not static, since base class sub-objects are part of the consideration, and you have two sub-objects of the same type, there's an ambiguity in the lookup.
But when they are static, there is no ambiguity. And to make it perfectly clear, the C++ standard even has a (non-normative) example when it describes class member lookup (in the section [class.member.lookup])
By Meeting C++ | Feb 18, 2018 06:38 AM | Tags: tools meetingcpp intermediate debug advanced
A great introduction into the inner workings of a compiler:
How C++ Debuggers work
by Simon Brand