461 reputation
48
bio website tommya.net
location Copenhagen, Denmark
age 33
visits member for 4 years, 6 months
seen May 15 at 21:06

System consultant at Schilling A/S developing ERP solutions for the publishing industry.

Bitbucket profile: https://bitbucket.org/tommyandersen
GitHub profile: https://github.com/Barium


Jan
7
comment How to deal with historic exception specifications in maintained C++ code
@RobK In my experience, that often happens when there is already something wrong with the code you're commenting. If your function tries to perform too many tasks for instance comments easily become obsolete. But functions should be kept simple with few (preferably 1) responsibility, this should not change over time. What might change is the variety of exceptions thrown from the function, and even that is not recommendable. In this case it is a simple task of updating the comment. The code might be self explanatory, but not necessarily the reason behind it.
Jan
7
comment Why would a program require a specific minimum number of CPU cores?
There are different techniques to checking which cpu core a thread is running on, and thereafter comparing between the threads, take a look at the answers to this question: stackoverflow.com/questions/6026896/… I am not entirely certain that this is what you are after though.
Jan
7
comment Why would a program require a specific minimum number of CPU cores?
This might be a duplicate of stackoverflow.com/questions/150355/…
Jan
7
revised Is it always safe to shift bool values?
Fixed typo
Jan
7
awarded  Yearling
Jan
7
revised Is it always safe to shift bool values?
Added code example
Jan
7
answered Is it always safe to shift bool values?
Jan
7
answered How to deal with historic exception specifications in maintained C++ code
Jan
6
comment How to deal with historic exception specifications in maintained C++ code
Possibly move them to the function comment block.
Sep
13
comment Undefined behavior, in principle
A different compiler, or the same compiler under different settings, different optimization levels, or perhaps even on a different system, might compile the code differently. You cannot know for certain what the results will be. As it is up to the inner "black magic" of the compiler, and it is possibly influenced by options and other outside parameters, making it possibly not reproducible, and even if it were, not advisable. If you want to learn about the stack there are better ways to do so, I would perhaps suggest looking at a valid codes assembly output.
Aug
29
awarded  Commentator
Aug
29
comment Uniqueness of for loop
@MichaelT that is true, in which case it works as an expression separator, rather than a parameter separator, as you write :)
Aug
29
revised Uniqueness of for loop
added 202 characters in body
Aug
29
answered Uniqueness of for loop
Aug
17
comment Is it an anti-pattern to use void* and enums to enable type-checking?
dynamic_cast might throw an exception if casting to a reference type, if casting to a pointer type it will instead return a null pointer of that type, if it fails. (CPP standard §5.2.7.9)
Aug
5
awarded  Enlightened
Aug
5
awarded  Nice Answer
Aug
4
comment Why is the JavaScript-language different in different programs/sites?
@Snowman JavaScript is superset of ECMAScript
Aug
4
comment Why is the JavaScript-language different in different programs/sites?
With programming once you learn one language, learning another becomes much more easy. It is often the concept of programming that one struggles to learn at first, once you got that right the syntax of the different languages, are easy to learn. In my opinion it doesn't matter which language you learn first.
Aug
4
awarded  Editor