Documentation | Legacy | Tips |
Moved the portable and macOS default executor singletons to a .cpp file to make it easier to package in a DLL without getting duplicated thread pools or pre-exit handlers.
Moved the pre-exit handling registry to a .cpp file to make it easier to avoid duplication when packaged as a DLL; the symbols vector throughextern "C" stlab_xxx()
function to make it simpler to export the necessary symbols.
Full Changelog: https://github.com/stlab/libraries/compare/v2.0.0a9…v2.0.0a10
For older releases, the full list is availableon GitHub.Forest: An Introduction
Hierarchies. Everyone uses them, so why are they difficult to maintain? In this article we exploreforest
, a data structure that makes hierarchies self-maintainable, so you can go back to thinking about the data they contain.
Small Object Optimization for Polymorphic Types
AtMeeting C++ 2017 I presented a lightning talkPolymorphic Task Template in Ten which showed an easy way to implement a polymorphic task template, similar tostd::function
, with a small object optimization in 10 minutes.
Unfortunately, the small object optimization, as described, leads toundefined behavior. As a general rule, you cannot store an object of one type in memory and read it back as another, even if the other type is the objects base class (there are exceptions to this rule, but they do not apply to this situation).
This tip looks at the details of the issue and describes a solution which turns out to be more efficient although it does require slightly more, and more complex, code to implement. A small object optimization for polymorphic types is a very useful construct so it important to understand how it can be done correctly.
New Concurrency Library
A new concurrency library was added as a first one to this new stlab instance.
This library provides an alternative to the C++11/14 and upcoming C++17 TS futures. As well it provides an implementation of channels that allow the creation of process graphs.
subscribevia RSS