1,072 reputation
712
bio website
location Netherlands
age 42
visits member for 4 years
seen yesterday

1d
comment Tips for understanding big project fast?
Visual Studio has a "show definition" functionality. Try right-clicking on the name and look at the pop-up menu. I've witnessed problems with it, but it usually is better than using ctrl-F.
Jan
25
answered What is the point of making a syntactic distinction between standard and user-defined types?
Jan
20
awarded  Nice Answer
Jan
15
awarded  Nice Answer
Jan
11
comment How to structure a loop that repeats until success and handles failures
This is the logical next step after the rewrites in my answer.
Jan
11
comment How to structure a loop that repeats until success and handles failures
@DocBrown The duplication of the cout is mostly an artifact of the example. In practice, the two cout statements will be different as the second will contain an error message. E.g. "Please enter <foo>:" and "Error! Please re-enter <foo>:".
Jan
10
awarded  Yearling
Jan
8
answered How to structure a loop that repeats until success and handles failures
Nov
9
comment What's wrong with statically linking the STL into multiple shared libraries?
@KonradRudolph Among others, (N)RVO optimalisations create situations where the returned string is constructed by libA.so while destructed by libB.so.
Aug
29
comment Best practice for unused inherited virtual functions (implementing superclass methods)
You can insert an using Base::foo1; in class A, after which A::foo1(1); will work.
Jul
9
comment Value of passing by reference
"Why have both?" Because there are differences between the two, and C++ lets you decide which one fits your situation best. See the link for the differences.
Jul
7
comment How to solve linear recurrences involving two functions?
Usually the next step is a Eigen-value/Eigen-vector decomposition of the matrix, after which an explicit formula for F(n) and G(n) can be derived.
Jul
2
comment What does “ (int) value & 0x1, (int) value & 0x2, (int) value & 0x4, (int) value & 0x8 means”
The wording may suggest that it can be extended to all numbers, which is not true: 8/6 is odd, while 8&6 yields false.
May
2
comment heading in right direction? C++ and class templates
Try this->numfields_. Without the this->, templatized base classes are not considered. Look for 2-phase lookup for details.
Apr
20
revised Estimed number of tries
added 1 character in body
Apr
20
revised Estimed number of tries
added 108 characters in body
Apr
20
comment Estimed number of tries
@Stefan4024 I don't understand why ans += x * p; yields the correct answer. Apparently it does, as you said it was accepted as answer. I can explain why p halves: for each bit sequence that isn't clear yet, the next bit will make it clear in half of the cases, and postpones it in the other half. But I don't understand the formula for x. I would have expected something like ans += (N-1)*p for odd N, as there are N-1 undetermined bit sequences at any point (for powers of 2, there will be less such sequences), but I don't see how x*p adds up to N-1. My intuition fails me here.
Apr
20
comment Estimed number of tries
@Stefan4024 x = (x*2) % N doubles x in every iteration, until it becomes greater than N. E.g. for N=13, x will be 1, 2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7, 1. Especially at the start, the doubling is clearly visible.
Apr
20
revised Estimed number of tries
deleted 4 characters in body
Apr
20
revised Estimed number of tries
deleted 4 characters in body