Taming the Performance Beast - Klaus Iglberger - Meeting C++ 2015
The last video from Meeting C++ 2015 is online:
Taming the Performance Beast
by Klaus Iglberger
March 23-28, London, UK
By Meeting C++ | Aug 3, 2016 01:15 AM | Tags: performance intermediate efficiency c++11 basics advanced
The last video from Meeting C++ 2015 is online:
Taming the Performance Beast
by Klaus Iglberger
By Jason Turner | Aug 1, 2016 02:05 PM | Tags: c++17 basics
Episode 22 of C++ Weekly.
C++17's Nested Namespaces and `std::clamp`
by Jason Turner
About the show:
This week Jason describes C++17's nested namespace support and the new library function `std::clamp`.
By Jason Turner | Jul 25, 2016 03:23 PM | Tags: c++17 basics
Episode 21 of C++ Weekly.
C++17's `if` and `switch` Init Statements
by Jason Turner
About the show:
This week Jason introduces C++17's new support for initializers in `if` and `switch` statements.
By Adrien Hamelin | Jul 25, 2016 02:07 PM | Tags: c++11 basics
Quick A: No, there is a specified syntax for it.
Recently on SO:
Is the new C++ return syntax limited?
Yeah, this is not something you'd normally guess.
virtual auto what() const noexcept -> const char * override;This is just the order you have to use. The syntax could have been different, probably, but this is what we've got.
By Adrien Hamelin | Jul 21, 2016 02:04 PM | Tags: basics
Did you know the difference?
Parameter or Argument?
by Malte Langkabel
From the article:
I often hear people getting confused when talking about parameters and arguments. That confusion grows even stronger when one of them knows the difference but the other one doesn’t. So let’s shed some light on this issue and spread the knowledge! Programming involves talking to each other but that doesn’t have to be more painful than it already is
By Marco Arena | Jul 20, 2016 07:09 AM | Tags: c++14 basics
In this installment we’ll meet associative containers:
C++ in Competitive Programming: associative containers
by Marco Arena
From the article:
Some days ago I gave my birthday party and I invited some friends. I want to know which name is the most common among my friends. Or, given a sequence of words, I want to know which one occurs the most...
By Adrien Hamelin | Jul 18, 2016 01:31 PM | Tags: c++11 basics
Quick A: To express constness, a const reference is what is needed.
Recently on SO:
How to express constness of a forwarding reference?
How can I express that f does not modify its parameter?If the function doesn't modify its parameter then there is no benefit to using a forwarding reference. You use a forwarding reference when you want to forward the parameter on to some other function which cares whether the argument is an lvalue or an rvalue (because maybe there are separate overloads for lvalues and rvalues, and the rvalue one can be more efficient).
If your function doesn't modify the argument then it shouldn't need to care whether it has an lvalue or rvalue, so it can just take
const T&unconditionally. That can bind to both lvalues and rvalues, and promises not to modify the parameter.template<typename T> void f(const T& t) { ... }
By Adrien Hamelin | Jul 18, 2016 01:28 PM | Tags: community basics
Quick A: Not in the standard, but in other libraries yes.
Recently on SO:
Is there a range class in C++11 for use with range based for loops?
The C++ standard library does not have one, but Boost.Range has boost::counting_range, which certainly qualifies. You could also use boost::irange, which is a bit more focused in scope.
By Jason Turner | Jul 12, 2016 12:50 PM | Tags: efficiency c++14 basics
Episode 19 of C++ Weekly.
C++14 For The Commodore 64
by Jason Turner
About the show:
This week Jason demonstrates using modern C++ to write extremely efficient high level programs for the Commodore 64.
By Adrien Hamelin | Jun 29, 2016 01:42 PM | Tags: basics
Quick A: They are not, because it is not always true.
Recently on SO:
Are `==` and `!=` mutually dependent?
You would not want the language to automatically rewrite
a != bas!(a == b)whena == breturns something other than abool. And there are a few reasons why you might make it do that.You may have expression builder objects, where
a == bdoesn't and isn't intended to perform any comparison, but simply builds some expression node representinga == b.You may have lazy evaluation, where
a == bdoesn't and isn't intended to perform any comparison directly, but instead returns some kind oflazy<bool>that can be converted to bool implicitly or explicitly at some later time to actually perform the comparison. Possibly combined with the expression builder objects to allow complete expression optimisation before evaluation.You may have some custom
optional<T>template class, where given optional variablestandu, you want to allowt == u, but make it returnoptional<bool>.There's probably more that I didn't think of. And even though in these examples the operation
a == banda != bdo both make sense, stilla != bisn't the same thing as!(a == b), so separate definitions are needed.