Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
detrino
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
61.
▲
by
detrino
11y ago
This isn't a compile-a-list-for-me site, it's fair game to question whether restricting yourself to female only blogs is the best course of action here.
62.
▲
by
detrino
11y ago
You cannot implement cache efficient data structures using void pointers.
63.
▲
The C++ Concepts TS was voted out today
(twitter.com)
4 points
by
detrino
11y ago
|
0 comments
64.
▲
by
detrino
11y ago
There was a proposal[1][2] for C++17 to allow: for (e : c) which would be equivalent to: for (auto &&e : c) Gcc implements this when compiling with -std=c++1z. My understanding is that it was rejected by the commit
65.
▲
by
detrino
11y ago
C# is gonna be your best bet.
66.
▲
by
detrino
11y ago
Sorry, it's early, I was thinking about cuckoo hashing.
67.
▲
by
detrino
11y ago
My understanding is that Robin Hood hashing has worse performance than linear probing due to greater cache misses. If you are looking for low memory overhead ordered sets/maps, then B-Trees can provide that.
68.
▲
by
detrino
11y ago
Are you overloading "expense" here to mean something other than runtime performance?
69.
▲
by
detrino
11y ago
size_t's raison d'etre is portability, you should be using it for things that are indexes/sizes into memory. FWIW, I don't have the karma to downvote.
70.
▲
by
detrino
11y ago
People downvote incorrect information all the time.
71.
▲
by
detrino
11y ago
Your rant against size_t and portability is misplaced as size_t increases portability when used appropriately.
72.
▲
by
detrino
11y ago
I am addressing the specific example given by the Google style guide. The code for counting down using a signed integer as they do has more corner cases than the while loop I have shown. Using their way, you have to remember to subtract 1 f
73.
▲
by
detrino
11y ago
I disagree that a signed type is the correct solution to that, rather you need a while loop: std::size_t i = foo.size(); while (i != 0) { --i; ... }
74.
▲
by
detrino
11y ago
This kind of interface has precedent: http://en.cppreference.com/w/cpp/experimental/optional/opera...
75.
▲
by
detrino
11y ago
You misunderstand the point of reference-to-const in C++. It is just a const view of an object, it makes no promises about the object itself. For functions returning a reference-to-const, the value of the contract is for the function, not t
76.
▲
by
detrino
11y ago
The standard defines preconditions when talking about what operations on valid on its containers. std::string::clear() has no preconditions so it is valid to call on a moved from object and then you can be sure of its state.
77.
▲
by
detrino
11y ago
I wonder if this is really faster than just writing it as a loop.
78.
▲
by
detrino
11y ago
I don't see how this helps here, unless you intend to call the closure several times per case.
79.
▲
by
detrino
11y ago
Unless you are Greg Ewing, you should probably choose a new name.
80.
▲
by
detrino
11y ago
Because when you split the root, it can only have 2 children.
81.
▲
by
detrino
11y ago
Cache coherency is something else. But ya, B-Trees will (sometimes significantly) outperform BSTs for small keys because they will have fewer cache misses. Also interesting is that the idea that RB-Trees are faster than AVL trees for insert
82.
▲
by
detrino
11y ago
Relaxed access of atomics performs no synchronization.
83.
▲
by
detrino
11y ago
From tsan documentation: "A data race occurs when two threads access the same variable concurrently and at least one of the accesses is write"
84.
▲
by
detrino
11y ago
From wikipedia: A race condition or race hazard is the behavior of an electronic, software or other system where the output is dependent on the sequence or timing of other uncontrollable events. Example: https:/&#
85.
▲
by
detrino
11y ago
Rust doesn't get to redefine "data race".
86.
▲
by
detrino
11y ago
That's not true, Rust permits opt-in data races in safe code.
87.
▲
by
detrino
11y ago
Both Rust and C# provide throwing/failing interfaces for parsing, it's just that Rust's is written: let foo: u32 = "3".parse().unwrap(); and C#'s is written: var foo = uint.Parse("3");
88.
▲
by
detrino
11y ago
Overcommit is just one configuration on Linux, it is a good default, but there are domains where you would disable it. How is Parse any less explicit than unwrap ?
89.
▲
by
detrino
11y ago
I'm not glossing over it, I said that this is better written using results. Complaining about the existence of Parse is like complaining about the existence of unwrap in Rust. C++ (another systems language) is probably a better compari
90.
▲
by
detrino
11y ago
Both exceptions and results are important for software architecture. The lack of the former leads to an oversimplification of interfaces in languages with only the latter. The author hit upon an example that is probably better written using
More ›