J
James Kanze
- Shall I start adding "throw()" to all functions - and ensure
that none of them actually throws by wrapping the code into
try / catch blocks?
Only if it's an important part of their contract that they don't
throw. (Note that a function which guarantees that it doesn't
throw can't use any of the standard containers, including
std::string.)
- Does it make any difference to use clock_t against
std::clock_t (and the alike, using C functions incorporated
into the std namespace)?
Formally, if you include <ctime>, it's std::clock_t, and if you
include <time.h>, it's clock_t (or ::clock_t). I generally
prefer the latter---it's a C interface, and should look like
one. (Also, I work a lot on Posix based systems, where the C
headers are somewhat modified anyway.)