Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mihai_ionic
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
mihai_ionic
13y ago
Have you looked at Boost.Proto? You can in principle manipulate syntax trees in any way you like, but you'll have to spice things up a little to fit with operator overloading.
32.
▲
by
mihai_ionic
13y ago
C++ has <chrono>, which guards against this kind of mistake by using the type system.
33.
▲
by
mihai_ionic
13y ago
Because in C++ the rule is "you only pay for what you use." All the things you want would incur a performance penalty were they the default.
34.
▲
by
mihai_ionic
13y ago
That's sort of the fault of the hardware vendors though for not proposing any viable extensions that expose texture swizzling. Why would it get any better with a new API?
35.
▲
by
mihai_ionic
13y ago
libgcm is pretty much just OpenGL with a few Sony specific extensions - plus you have to use their headers which use macros to build the command lists, probably pulled right out of NVidia's driver code. It's quite fascinating how
36.
▲
by
mihai_ionic
13y ago
VOD of the announcement is available here: http://www.livestream.com/amdlivestream/video?clipId=pla_334... . Mantle information starts at 02:26:40.
37.
▲
by
mihai_ionic
13y ago
More information still coming out on the live stream: http://www.livestream.com/amdlivestream . Edit: It's over now. The VOD is available here: http://www.livestream.com/amdlivestream/video?clipId=p
38.
▲
AMD announces Mantle, a low-level graphics API replacement for Direct3D/OpenGL
(imgur.com)
10 points
by
mihai_ionic
13y ago
|
2 comments
39.
▲
by
mihai_ionic
13y ago
template <typename T> void remove(std::vector<T>& v, std::size_t i) { std::swap(v[i], v.back()); v.resize(v.size() - 1); }
40.
▲
by
mihai_ionic
13y ago
That's not what he said, and his solution is not "inefficient." CPUs have no emotions; if it runs faster due to cache, it's simply the better solution. For the use case required by ZeroMQ, it's faster in all cases,
41.
▲
by
mihai_ionic
13y ago
Even in C, setjmp/longjmp leave all non-volatile automatic storage duration variables on the current stack frame in an indeterminate state if they are modified between the two calls. To get defined behaviour with regards to destructors
42.
▲
by
mihai_ionic
13y ago
I'd like to know what restrictions cause you not to be able to use RAII. Even if that's the only C++ feature that a project were to use, I'd still consider it a net gain. Anything that makes your program less susceptible to m
43.
▲
by
mihai_ionic
13y ago
Add the modern L4 microkernels to that list, e.g.: https://github.com/l4ka/pistachio
44.
▲
by
mihai_ionic
13y ago
1) It's 2013, all major compilers (GCC, Clang, MSVC, ICC) have supported rvalue-references for multiple releases. 2) You missed the part where there's nothing preventing anyone from using intrusive lists in C++.
45.
▲
by
mihai_ionic
13y ago
Since you never traverse the list, the order of elements obviously doesn't matter. In that case, you can just swap the element to remove with the last element. A vector will still give you better cache-locality and also amortize the nu
46.
▲
by
mihai_ionic
13y ago
If you can use C++11, this becomes a non-issue with move semantics. Ownership of internal resources can be transferred, and emplace_back even allows constructing your object in place. As others said, the O(n) really becomes more like pseudo
47.
▲
by
mihai_ionic
13y ago
The point of intrusive lists is to allow access to the link when you provide only the contained object. The way you're thinking of would theoretically work, but you'd have to make sure the compiler isn't adding fancy padding
48.
▲
by
mihai_ionic
13y ago
No, the ZeroMQ author should be writing idiomatic code in whatever language he is using. In his blog post, he complains that std::list<widget* > causes 2 allocations per insertion. Fine, because that's not idiomatic C++. The C++
49.
▲
by
mihai_ionic
13y ago
It has also been pointed out that these problems are not intrinsic to C++, but rather due to the way he was using it: http://www.codeofhonor.com/blog/avoiding-game-crashes-relate...
50.
▲
by
mihai_ionic
13y ago
Seeing as I consider Qt to be a particularly badly designed C++ library, this speaks volumes about how cumbersome some C APIs are to use. Not that there is any real alternative for a cross-platform UI toolkit.
51.
▲
by
mihai_ionic
13y ago
> That said, avoiding libraries (especially avoiding templates and just using void*-like stuff) does keep binaries/libs smaller, but I'll gladly make the computer work slightly harder considering that the result is the same spe
52.
▲
by
mihai_ionic
13y ago
I knew I should have just called it bind. As a bonus, an actual implementation of curry: https://dpaste.de/qGWcq/
53.
▲
by
mihai_ionic
13y ago
C++14 version: https://dpaste.de/a8g9D/ You obviously can't pass this to C code, but it's a portable and extremely efficient solution if you are working purely within a C++ code-base.
54.
▲
by
mihai_ionic
14y ago
Nice, my application which is not even on page one in Google Play search appears as the first result for the same keyword in Google Applications.
55.
▲
by
mihai_ionic
14y ago
Isn't it a backup of the data in the person's brain, and thereby considered "electronic storage"?