-
I provide an elegant and useful implementation of a named tuple.
-
This is just awesome! For those who love C++.
Structure Data Members as a Type List Using Pure C++
There is no standard way of doind reflection in C++ right now. But if all you need are data member types then this can help.
Best way to think of algorithms is in steps (don't try to grok it as a whole)
Visual C++ Struct Layout Reminder
Microsoft Visual C++ (64 bit mode) has different layout between seemingly very similar data structures. Be warned.
-
I wish I learned that simple software design principle earlier.
Useful Properties of String Interning in C++
I show how to get string interning in C++ and what benefits it brings.
Undefined Behaviour and Optimizations: GCC vs Clang vs MSC
Was thinking the other day about undefined behaviour and optimizations it allows and came up with a couple interesting short samples.
When should One Use r-value References and noexcept
Some thoughts on when to use move semantics and exception specifiers.
-
What lessons can we learn from garbage collectors.
Lets Talk About Error Handling...
What's really the right way to handle program errors? I have some ideas.
-
How to properly round a floating point number?
C++ Templates and Static Initialization
OrderHellRan into a nasty problem with how the global static objects are initialized in templates.
Color Throne - Brain Gymnastics
Released my first Android application on Google Play. It's a color puzzle-arcade game. Any installs and positive reviews are much welcome.
atomic_data: A Multibyte General Purpose Lock-Free Data Structure
My greatest work so far. I am writing about lock-free programming gotchas and also present a hopefully novel design: atomic_data.
Using Macro Kung Fu to Easier Check Function Return Values
Checking multiple function calls with one macro.
Program execution could be viewed as data flowing across scopes.
Some Problems with C++ Move Semantics
The C++ brings joy, but problems too.
Free Variables Perfect Hashing Algorithm
A generalization and simplification of the CHM Perfect Hashing Algorithm.
-
Consistent hashing is used to balance load in case a bucket (server) goes bad.
-
One more nugget from C++.
When serializing data into a file, developers often make a dry run to calculate the size for the header. One possible workaround: add a size data member as the last field in the header struct, then just write the header at the end of the file.
-
Some thoughts on using values vs pointers/references.
-
A couple notes on polymorphic behaviour.
-
Neverending struggle to work out the rules of using C++ exceptions, my thoughts on that.
TLDR. Use them almost always.
#define that (*this)
that.value = ...
std::vector<int> v{}; int i{};
v << 1 << 2;
v >> i;
Print-format a Float in Base-10
A hack for quick and easy printing of a floating point number in base-10.