of course, you call the sort function at compile-time and the returned function at run-time, which is hilarities, but not fundamentally equivalence-breaking
more like, I keep forgetting and half the sample is written in the last version and half the sample is in the new version and it doesn't make sense when you put it together :P
especially since I haven't finalized any of my library design yet
@DeadMG I don't believe in the theory behind it, the infinite-parallelism. After all, nobody's made it work for any problem that couldn't be solved on a 4004 based calculator. That one was 4-bit.
@CheersandhthAlf The algorithm works. You can simulate it on a classical computer with enough memory. A quantum computer is just a "native" implementation, as it were.
that has the benefit that you can precisely say up to what level you want to immediately look into. for example is_lvalue_reference<add_rvalue_reference<T>::now type>::value
Yes, I agree that the algorithm works. I just don't believe in the fancy Everett interpretation of quantum physics, where each little planc time produces a near infinite branching of correlated universes. It's a bit too silly.
but since i did not prefix "value" with "now", we wait until instantiation for the dependent name, and then when we substitute an lvalue ref for T in "T&&" , we will get "true"
@CheersandhthAlf The whole of quantum physics is absurdly silly. Firstly, the many-worlds interpretation is just one, but secondly, I don't find it any more unintuitive than things like the Heisenberg Uncertainty Principle
The Intel 4004 was a 4-bit central processing unit (CPU) released by Intel Corporation in 1971. It was the first complete CPU on one chip, and also the first commercially available microprocessor. Such a feat of integration was made possible by the use of then-new silicon gate technology allowing a higher number of transistors and a faster speed than was possible before.
History and production
The first public mention of 4004 was an advertisement in the November 15, 1971 edition of Electronic News, though unconfirmed reports put the date of first delivery as early as March 1971. Pa...
note that the "T" needs to be a parameter of the outer template, so that it is already resolved (at instantiation) when we early-on resolve the dependent name used in the argument of the partial specialization.
that code can only match patterns with 2 placeholders
because if the pattern does not contain either _1 or _2, then either A or B cannot be deduced for the partial specialization and it will never be selected
@FredOverflow does it make sense?
i wonder whether i should make a proposal for wg21 about it
I have a struct that's defined like this:
struct Vec3 {
float x, y, z;
}
When I attempted to use std::unique on a std::vector<Vec3>, I was met with this error:
Description Resource Path Location Type
no match for ‘operator==’ in ‘_first._gnu_cxx::__normal_iterator<_It...
The question of why you have to provide operator== is not the same as the question of why you have to provide some comparison function.
Regarding the latter, the reason that you are required to provide the comparison logic, is that element-wise equality is seldom appropriate. Consider, for examp...
I have this big program that is written in lock-based code and now I have to make it STM.
Took me a few weeks just to find some sort of starting point :)
Since I only work on it in the weekends, sometimes.
A frequent problem is that not all resources are memory. Locks can protect both memory and non-memory resources (e.g. log stream) in the same scope. STM only deals with memory. Furthermore, since transactions can be retried, the non-memory resources should not be accessed from inside the transactions. (Perhaps this is OK for transactions that only do reading.)