Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
thestoicattack
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
thestoicattack
8y ago
I guess wait for libstdc++ to implement the Coroutines TS that got merged into the C++20 standard?
62.
▲
by
thestoicattack
8y ago
Ooh, I like that new 'Image usage. I was told that adding the identifier to the end of blocks is just a good practice, since the compiler can tell you if you misread the nesting and wrote the wrong name.
63.
▲
by
thestoicattack
8y ago
Unless you are writing one-off programs that you never come back to -- which is certainly possible! -- it's possible that "future you" is the next programmer.
64.
▲
by
thestoicattack
8y ago
The tradeoff is that emplace_back and push_back need to check the capacity (even though they won't reallocate because of reserve). Whereas with resize, assignments into the initialized area need no checks at all.
65.
▲
by
thestoicattack
8y ago
I think Compiler Explorer shows that it usually doesn't, unfortunately.
66.
▲
by
thestoicattack
8y ago
For me, the overhead of keeping track of size and capacity is still pretty thin. It's not like it's a linked list or something. The overhead is thin but non-zero.
67.
▲
by
thestoicattack
8y ago
I was being a little flippant and unfair to Java because I was trying to find where the claim "everything is a class" had appeared from.
68.
▲
by
thestoicattack
8y ago
That's Java, isn't it? I write lots of C++ without classes.
69.
▲
by
thestoicattack
8y ago
I don't think C++ comes with the OOP mindset. At least, not recently. Most people will tell you it's "multi-paradigm." And I would say C++ certainly gives you enough flexibility to dig underneath the abstractions, as TFA
70.
▲
by
thestoicattack
8y ago
The most surprising part of this to me was the speedup from replacing std::vector. They write, "We don’t need resize or push_back in our code, all arrays are initialized with the right size." But if you're not doing any resiz
71.
▲
by
thestoicattack
8y ago
No std::unique_ptr?
72.
▲
by
thestoicattack
8y ago
Oh, ouch. I never knew about that one. I assume it's an effect of various "#define NULL 0" type things that got stomped by the introduction of nullptr in C++11?
73.
▲
by
thestoicattack
8y ago
That's a good point. I use references, even with that mental overhead, because they're not nullable. Clearly there are trade-offs.
74.
▲
by
thestoicattack
8y ago
> the new C++ compiler is throwing you a 10 lines error message just because that codebase is 10yo and isn't up to scratch with the 'new' way of doing things Does this happen? I thought the committee was so into backwards-
75.
▲
by
thestoicattack
8y ago
I was with you until "you cannot use references." Why not?
76.
▲
by
thestoicattack
8y ago
Two is prime.
77.
▲
Argument in Apple v. Pepper [pdf]
(supremecourt.gov)
1 points
by
thestoicattack
8y ago
|
0 comments
78.
▲
by
thestoicattack
8y ago
Here's that Rolling Stone article: https://www.rollingstone.com/politics/politics-news/don-eyle...
79.
▲
by
thestoicattack
8y ago
A talk by that paper's author: https://www.youtube.com/watch?v=JhUxIVf1qok
80.
▲
2018 San Diego ISO C++ Committee Trip Report
(old.reddit.com)
2 points
by
thestoicattack
8y ago
|
0 comments
81.
▲
by
thestoicattack
8y ago
Don't forget the planned city that actually got built -- Brasilia. Niemeyer was a disciple of Le Corbusier.
82.
▲
by
thestoicattack
8y ago
If the icons were good, the quiz wouldn't need to exist, right? So the mere fact that there is a quiz already biases the result.
83.
▲
Tindallgrams
(tindallgrams.net)
112 points
by
thestoicattack
8y ago
|
13 comments
84.
▲
by
thestoicattack
8y ago
I'm not understanding what awk has to do with your other points.
85.
▲
by
thestoicattack
8y ago
> When reporting on mismatching template types, the C++ compiler will now use color to highlight the mismatching parts of the template, and will elide the parameters that are common between two mismatching templates, printing [...] inste
86.
▲
by
thestoicattack
8y ago
> deprecated in c++11 Not only that -- it was removed in C++17!
87.
▲
Abc News
(math.columbia.edu)
1 points
by
thestoicattack
8y ago
|
0 comments
88.
▲
by
thestoicattack
8y ago
As an aside, doing find -exec [...] + (note + instead of \;) will exec one grep process for as many arguments as possible, instead of one grep process per file.
89.
▲
by
thestoicattack
8y ago
C++17 has if-statement initializers, so you can do if (auto x = re_match(foo, bar); x.has_value()) { (or x.ok() or whatever the name is of the method that tells you the validity of x)
90.
▲
by
thestoicattack
8y ago
From the "interview" of "Stroustrup": > ... You know, when we had our first C++ compiler, at AT&T, I compiled 'Hello World', and couldn't believe the size of the executable. 2.1MB > Interviewer:
More ›