Data oriented design in practice - Stoyan Nikolov - Meeting C++ 2018
A talk on data oriented design with realworld examples
Data oriented design in practice
by Stoyan Nikolov
By Meeting C++ | Jan 26, 2019 08:10 AM | Tags: meetingcpp intermediate c++14 c++11 basics advanced
A talk on data oriented design with realworld examples
Data oriented design in practice
by Stoyan Nikolov
By Adrien Hamelin | Jan 17, 2019 01:20 PM | Tags: basics
Not helping you.
Don’t pass lambdas (or other multi-line entities) as parameters to macros
by Raymond Chen
From the article:
Consider this macro:
#ifdef DEBUG #define LOG(value) LogValue(value) #else // In production, evaluate but don't log. #define LOG(value) (value) #endifThis seems not entirely unreasonable, but bad things happen if you pass a multi-line entity as the macro parameter...
By Meeting C++ | Jan 12, 2019 12:45 PM | Tags: meetingcpp intermediate experimental efficiency c++17 basics advanced
Andrei Alexandrescus Opening Keynote from Meeting C++ 2018
The next big Thing
by Andrei Alexandrescu
By Adrien Hamelin | Jan 9, 2019 01:09 PM | Tags: c++11 basics
Quick A: Write the type!
Recently on SO:
How to use auto keyword to assign a variable of type uint32_t or uint64_t in C++
I'm assuming you're working with the AAA style suggested by Herb Sutter.
In that case, a nice solution is to simply write:
auto variable_name = uint64_t{ 5000000000 };This is clear, consistent, and explicitly typed with no nasty C-preprocessor necessary.
By Adrien Hamelin | Jan 9, 2019 12:56 PM | Tags: basics
And it may be respected.
const is a contract
by Arthur O’Dwyer
From the article:
Here’s a slogan that needs more currency...
By Adrien Hamelin | Dec 20, 2018 02:19 PM | Tags: basics
Keep it simple!
Simple data structures
by Arne Mertz
From the article:
Keep simple data structures simple! There’s no need for artificial pseudo-encapsulation when all you have is a bunch of data...
By Meeting C++ | Nov 30, 2018 04:15 AM | Tags: performance meetingcpp intermediate experimental efficiency community c++17 c++14 c++11 basics advanced
Pictures and more about Meeting C++ 2018!
Meeting C++ 2018 wrap up
by Jens Weller
From the article:
Two weeks ago, Meeting C++ 2018 started. The first attendees got their badges and it was again this time of year for my staff, the volunteers and myself: conference time...
By Adrien Hamelin | Nov 29, 2018 01:36 PM | Tags: community basics
Agree with the logic?
How to Design Function Parameters That Make Interfaces Easier to Use (2/3)
by Jonathan Boccara
From the article:
Let’s continue exploring how to design function parameters that help make both interfaces and their calling code more expressive.
If you missed on the previous episode of this topic, here is what this series of articles contains:
- Part 1: interface-level parameters, one-parameter functions, const parameters,
- Part 2: calling contexts, strong types, parameters order,
- Part 3: packing parameters, processes, levels of abstraction.
By Adrien Hamelin | Nov 27, 2018 02:10 PM | Tags: basics
Quick A: The returned variable can be modified.
Recently on SO:
What does it mean to return a reference?
It means you return by reference, which is, at least in this case, probably not desired. It basically means the returned value is an alias to whatever you returned from the function. Unless it's a persistent object it's illegal.
For example:
int& foo () { static int x = 0; return x; } //... int main() { foo() = 2; cout << foo(); }would be legal and print out 2, because foo() = 2 modifies the actual value returned by foo.
However:
int& doit () { int x = 0; return x; }would be illegal (well, accessing the returned value would), because x is destroyed when the method exits, so you'd be left with a dangling reference.
Returning by reference isn't common for free functions, but it is for methods returning members. For example, in the std, the operator [] for common containers return by reference. For example, accessing a vector's elements with [i] returns an actual reference to that element, so v[i] = x actually changes that element.
Also, I hope that "is essentially equal to this code" means that they're semantically sort of (but not really) similar. Nothing more.
By Adrien Hamelin | Nov 12, 2018 01:23 PM | Tags: basics
Simple.
How to Retrieve the Firsts from a Collection of Pairs
by Jonathan Boccara
From the article:
When using the STL, there is a use case that pops up every now and then and that often causes more trouble than necessary: if we have a collection of pairs, like an std::vector of pairs, or simply a std::map, how can we retrieve the collection of the first elements of each item in the collection?