[timer] throwing constructor?

28 Mar
2004
28 Mar
'04
5:11 p.m.
The documentation for boost::timer says: "The constructors may throw std::bad_alloc." I don't see how they could. There are two of them; one is the compiler generated copy constructor and the other one is: timer() { _start_time = std::clock(); } Maybe the intent was to write it as: start_time = std::clock(); if (_start_time == (std::clock_t)(-1)) throw ...; ? But why the exception would be bad_alloc? PS: I haven't checked whether progress_timer and progress display have the same problem. PS2: I know that it is (the intent for it to be) allowed in class scope but shouldn't we refrain from using identifiers with a leading underscore? Genny.
7744
Age (days ago)
7744
Last active (days ago)
0 comments
1 participants
participants (1)
-
Gennaro Prota