141 karma · joined Dec 23, 2015 (10y ago) · 34 submissions
3.
Show HN: Lockless Variadic Futures for C++17(github.com ↗)
11 points · by Chabs · 7y ago · discuss
comment 7y ago · link · parent
https://coliru.stacked-crooked.com/a/be5c44281eea8bc4
Then only unfortunate missing piece of the puzzle is that there's no trivial way to create a closure out of this, so it requires a bit more manual work to propagate local state to the visitor.
comment 7y ago · link · parent
That's "technically" correct, but it feels like an academic cop-out. Interesting/useful transfer functions tend to be functions that take very large expansions to be approximated with any accuracy.
comment 7y ago · link · parent
Since modules operate at the language level, they need to operate on this notion, which precludes importing by file.
comment 7y ago · link · parent
> in other words, the reader is expected to understand the semantics of an unknown function without consulting the declaration (or documentation).
The idea that the author considers making code as self-documenting as possible at the call site a conceptual mistake is just weird to me.
comment 8y ago · link · parent
comment 8y ago · link · parent
There's a straight line from requirements to implementation; no meandering involved. At least that's the theory. In practice...
comment 8y ago · link · parent
Hot take: RAII has basically taken over everything else as far as structural design foundation goes. Type erasure and encapsulation still play a role, but it's not nearly as fundamental anymore.
comment 8y ago · link · parent
Specifically, the entropy within the box gets converted into information inside the demon's "head", which eventually gets radiated away as entropy outside the box. This way, the box's entropy falls, but the entropy of universe as a whole is raised (or at least maintained).
comment 8y ago · link · parent
Growth-wise, you have to keep in mind that the black hole doesn't grow when matter crosses the horizon, but when the matter gets close enough to the horizon that mass of black hole + mass of new matter creates a blackhole of a larger radius that encompasses that matter.
comment 8y ago · link · parent
On that note, benchmarks against a simple ASIO http server are a must if performance is your #1 stated goal.
comment 8y ago · link · parent
Heck just using std::numeric_limits<int>::min() will incur a function call in -O0, but nobody cares since it gets optimized in -O1 and up. The same thing applies more and more as you invoke templates from templates, but, again, nobody cares since we are confident it'll get optimized/inlined easily.
It's not nearly as prevalent in modern code since constexpr static variables are now a thing, but relying on these optimizations has historically been super important.