Active waiting Don’t use this approach, because it will unnecessarily consume CPU time. The sleep reduces the CPU consumption, but
Continue readingCategory: Development
The Pitchfork Layout (C++)
I recently stumbled over ‘The Pitchfork Layout‘ and I know there are so many ways to order your project files,
Continue readingDeclaration specifiers (C++)
The following list is just a selection. Specifier Variable Function const Can’t be modified.1 Method: Can’t modify its fields.1 constexp
Continue readingPosition of Ptr. / Ref. (C++)
There are two common ways for the position of the pointer sign (*) or the reference sign (&). C-Style ClassA
Continue readingWhen and how to pass smart pointer (C++)
This post is based on a post from Herb Sutter. When if (The ownership of the object isn’t shared or
Continue readingLayout of std::shared_ptr (libstdc++)
Source code Debugging Visual result |———————-| | shared_ptr sPtr1 | |———————-| |Pointer to the Object |—|——-> Object | | |
Continue readingLambda captures (C++)
Setup lambda auto func = [/*capures*/](/*arguments*/){/*body*/}; Specify captures <var> … Local variable by value &<var> … Local variable by reference
Continue readingQ&A – Programming (C++)
When do I need the headers for lib files? You need them during compilation if you build against libraries. You
Continue readingPosition of const (C++)
“West-Const vs. East-Const” West-Const (The common one) int * num = new int(42); // Mutable ptr to a mutable int
Continue readingstd::recursive_mutex (C++)
The std::mutex is a non-recursive mutex and therefore can’t be locked again from the same thread before getting unlocked. This
Continue reading