3,509 reputation
715
bio website
location
age
visits member for 2 years, 5 months
seen yesterday

Mar
28
answered Utterly Confused with OOP - How do I overcome a beginner's hurdle?
Mar
10
revised Using scoped enums for bit flags in C++
implement option 3
Mar
5
awarded  Nice Answer
Mar
5
revised Why do all <algorithm> functions take only ranges, not containers?
added 424 characters in body
Mar
5
comment Why do all <algorithm> functions take only ranges, not containers?
@svick that single object may reperesent a collection (or, again, some operation over a collection), but the OP was asking for it to be a collection, which is different. The range approach seems like a more reasonable compromise in C++ than some lazily-evaluated collection facade.
Mar
5
comment Why do all <algorithm> functions take only ranges, not containers?
@Hurkyl that's true, and the motivation behind Boost.Range.
Mar
5
comment Why do all <algorithm> functions take only ranges, not containers?
I agree the whole container, forwards case is very common, but wanted to point out that it's a much smaller subset of possible uses than the question suggested. Specifically because the choice isn't between whole container and partial container, but between whole container and partial container, possibly reversed or otherwise adapted. And I think it's fair to suggest that the perceived complexity of using adapters is greater, if you also have to change your algorithm overload.
Mar
5
answered Why do all <algorithm> functions take only ranges, not containers?
Feb
6
comment ANSI C pointers corrupted values
If it's a specific pointer getting corrupted, run under a debugger and add a watchpoint on the pointer. It'll break execution when something overwrites it. Otherwise, try using something like valgrind, or a static analysis tool, to detect buffer overruns.
Jan
30
comment Programming with Dyslexia
Irrelevant side-note: the key feature of an nxn matrix isn't the value of n, but the fact the matrix is square. Does that help?
Jan
27
comment A pattern to “atomically” update a pair of objects
Not really, you asked for a pattern and that's what this is. The idea is that ensuring atomicity isn't the responsibility of either individual account, but of a dedicated object. Ultimately you do need two method calls, you just wrap them in a Transaction to get the guarantee you requested.
Dec
20
revised How to represent a geometric line programmatically?
added 32 characters in body
Dec
18
revised How to represent a geometric line programmatically?
should stop direction test if first nonzero element is positive
Dec
18
answered How to represent a geometric line programmatically?
Dec
18
comment How to represent a geometric line programmatically?
Should that be L = R + tV?
Dec
6
comment Help me think in C++
some binary network protocols map naturally onto fixed-size structures, as do things like on-disk filesystem structures and some file formats. All of those also suit overlaying the struct onto buffers, to avoid redundant copying.
Dec
5
awarded  Enlightened
Dec
5
awarded  Nice Answer
Dec
5
answered Help me think in C++
Dec
2
revised Modularity and “encapsulation” in C
note on encapsulation