160 reputation
2
bio website
location
age
visits member for 3 years, 5 months
seen Jul 8 at 1:36

May
10
comment Are abstract classes / methods obsolete?
This question illustrates more than a simple application of the Template Method pattern - the public/non-public aspect is known in the C++ community as the Non Virtual Interface pattern. By having a public non-virtual function wrap the virtual one - even if initially the former does nothing but call the latter - you leave a point of customisation for setup/cleanup, logging, profiling, security checks etc. that might be needed later.
Mar
28
awarded  Critic
Mar
19
comment Is it a good practice to choose the highest warning level in C++ programming?
"[compilers] tend to know better then me if there is a mistake / not always true, due to compiler bugs" - it's not just about compiler bugs... you may know that your values won't span the range of a data type and therefore no actual signed/unsigned issues will occur (e.g. a vector of students in a class will never have an index that can't be stored in int) but it's still sloppy practice, or you may know that you really did mean to say if (x = y)... having to write if ((x = y)) is still a good practice as people who know the compiler warnings may understand that means it's intentional.
Jun
2
comment The “blub paradox” and c++
@Ferruccio: Thanks for the link... there are a few in the Wikipedia article too. @MSalters: what makes you describe co-routines as "a nasty hack"? Seems a very arbitrary perspective to me. Using a stack to store state also done by recursive algorithms - are they hackish too? FWIW, coroutines and OOP came on the scene about the same time (early 1960s)... to say the former's a hack for objects in C seems bizarre... I'd imagine few C programmers back then were interested in emulating objects, >15 years before C++.
May
30
comment C++ Interview question
@Jonathan: re no padding - for sign-manitude representation, perhaps -0 could be a sentinel value for traps, at least theoretically (i.e. if an architecture did that it could still be Standard-compliant)...?
May
11
awarded  Teacher
May
10
answered The “blub paradox” and c++
May
9
answered Why declare a variable in one line, and assign to it in the next?
Feb
1
answered Why do we have postfix increment?