Emscriptened -- Adi Shavit
The `path` to the web.
Emscriptened!
by Adi Shavit
From the article:
It might be a fun little project to generate a web-based interactive version of the effects of various methods of `filesystem::path`.
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Adi | Dec 29, 2016 09:34 AM | Tags: None
The `path` to the web.
Emscriptened!
by Adi Shavit
From the article:
It might be a fun little project to generate a web-based interactive version of the effects of various methods of `filesystem::path`.
By Adrien Hamelin | Dec 26, 2016 03:07 PM | Tags: community basics
How to return well:
Return early and clearly
by Arne Mertz
From the article:
There are different guidelines out there about where and how many return statements to use in a function, e.g. return only once at the end of the function or return early and often. Which one makes for the most readable code?
By Felix Petriconi | Dec 23, 2016 03:23 AM | Tags: performance intermediate c++11
Forster Brereton reports about his first steps to build a hybrid mutex.
Building a hybrid spin mutex in C++
by Foster Brereton
From the article
Blocking Mutexes
A blocking mutex will halt the thread until it acquisition. It is useful because it consumes negligible computer resources while blocked. This leaves the CPU free to perform other tasks, including whatever other task currently owns the mutex. All this goodness is not cheap, however: it takes a decent amount of time to block thread. If your critical section is brief, you could be spending a disproportionate amount of time protecting it instead of running it.
Generally, blocking mutexes should be used when your critical section will take a while, such as I/O operations, calling out to the OS, or doing laundry in a collegiate dorm.
Spinning Mutexes
A spinning mutex will enter into an infinite loop (spin) until acquisition. It is useful because it can resume very quickly once the lock has been obtained, resulting in minimal overhead while protecting a critical section. However, since the thread remains active on the CPU, it can reduce (or eliminate!) the ability of the CPU to do other work††. If your critical section is long, you could be spending a disproportionate amount of time protecting it instead of running it.
Generally, spin mutexes should be used when your critical section is brief, such as reading or writing a memory-resident data structure.Finding a middle ground
The dichotomy between the two mutex behaviors has left me stuck more than once. What if I was trying to protect a global resource that occasionally required a call to the OS? In those cases a blocking mutex is not a good fit, as modifying the memory-resident structure is pretty quick. However a spin mutex would be equally bad, because I do need to go to the OS time and again, and it would be a pessimization to spike a CPU while doing so.
By Niks | Dec 21, 2016 04:45 AM | Tags: c++14 advanced
Quantification expresses the extent to which a predicate is true over a set of elements. This installment describes the use of predicate logic in metaprogramming.
Quantifiers, metaprogramming and concepts
by Nikos Athanasiou
From the article:
Metaprograms often use predicate logic in creative ways. For example, type queries in generic code are used to constrain, dispatch, specialize, activate or deactivate code at compile time.
By Adrien Hamelin | Dec 19, 2016 11:19 AM | Tags: None
ACCU’s Overload journal of December 2016 is out. It contains the following C++ related articles.
Overload 136 is now available
From the journal:
The MirAL Story
Description : The X-Windows system is all-pervasive but struggles with security and performance graphics. Alan Griffiths introduces Mir Abstraction Layer to deal with these issues. by Alan GriffithsOverloading with Concepts
Description : Concepts can play a role in function overloading. Andrew Sutton shows us how. by Andrew SuttonUltra-fast Serialization of C++ Objects
Description : Serialising and de-serialising is a common problem. Sergey Ignatchenko and Dmytro Ivanchykhin demonstrate one way to do this quickly. by Sergey Ignatchenko and Dmytro IvanchykhinModern C++ Features: User-Defined Literals
Description : User-defined literals were introduced in C++11. Arne Mertz walks us through their use. by Arne MertzPython Streams vs Unix Pipes
Description : Dealing with an infinite sequence requires some thought. Thomas Guest presents various ways to approach such a problem. by Thomas GuestLetter
Description : Silas S. Brown comments on Steve Love's recent article. by Silas S. BrownHello World in Go
Description : Go provides a way to write efficient concurrent programs in a C-like language. Eleanor McHugh shares a "Hello, world!" tutorial. by Eleanor McHugh
By Meeting C++ | Dec 16, 2016 10:48 AM | Tags: video performance intermediate experimental efficiency community c++14 c++11 boost basics advanced
A week full of video editing brings the first batch of Meeting C++ 2016 videos online:
More videos are online!
by Jens Weller
Meeting C++ 2016 Playlist
From the article:
With today, almost all videos from the A and all videos of the D Track are online. There is a recording issue with one talk in the A track, which might get resolved in 2017. Also since today, the Meeting C++ YouTube channel has more then 400k views!
The full video set you can find in the Meeting C++ 2016 Playlist, the newest videos are easily found by visiting the Meeting C++ YouTube channel or subscribing to this RSS feed.
By Adi | Dec 15, 2016 11:41 PM | Tags: c++17
A short stroll along filesystem::path.
Path Exploration
by Adi Shavit
From the article:
The “experimental” Filesystem TS has been with us for a few years living in the std::experiment namespace. With C++17 it will finally be merged into std.
By bfilipek | Dec 15, 2016 11:40 PM | Tags: None
Another explanation why const is a really powerful tool.
Please declare your variables as const
by Bartlomiej Filipek
From the article:
When using const the resulting code will be more verbose, explicit, cleaner (with probably smaller functions) and safer. Not to mention that you’ll get additional help from the compiler.
By Adrien Hamelin | Dec 14, 2016 03:05 PM | Tags: intermediate c++11
A good question with a good answer.
When noexcept?
by Edouard of quasardb
From the article:
In a previous post, we had a look at the new constexpr keyword that has been introduced in C++ 11. Today we'll study another new fancy specifier: noexcept...
By Adrien Hamelin | Dec 12, 2016 02:55 PM | Tags: experimental basics
The new if constexpr
will change a good part of our code for the better!
Simplifying templates and #ifdefs with if constexpr
by Simon Brand
From the article:
if constexpr
is a C++17 feature which allows conditionally compiling code based on template parameters in a clear and minimal fashion. It is essentially an if statement where the branch is chosen at compile-time, and any not-taken branches are discarded without being instantiated...