Reputation
370
Top tag
Next privilege 500 Rep.
Access review queues
Badges
1 3
Newest
 Nice Answer
Impact
~728 people reached

  • 0 posts edited
  • 0 helpful flags
  • 1 vote cast
May
21
awarded  Nice Answer
May
21
awarded  Yearling
May
21
comment When NOT to use virtual destructors?
"will be an overhead in the constructor for creating the vtable" - the vtable's usually "created" on a per-class basis by the compiler, with the constructor only having the overhead of storing a pointer to it in the object instance under construction.
May
21
answered When NOT to use virtual destructors?
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
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?