#define implement_operator(op) \
bool Millisecond::operator op (const Second& other) const \
- throw ()\
+ \
{\
return a_value op (other.a_value * (type_t)1000);\
}\
bool Millisecond::operator op (const Microsecond& other) const\
- throw ()\
+ \
{\
return a_value op (other.a_value / 1000);\
}
Millisecond::Millisecond(const Microsecond& other) : a_value(other.a_value / 1000) {;}
Millisecond& Millisecond::operator= (const Second & other)
-throw() {
+{
a_value = other.a_value;
a_value *= (type_t)1000;
return *this;
}
Millisecond& Millisecond::operator= (const Microsecond & other)
-throw() {
+{
a_value = (other.a_value / 1000);
return *this;
}
//static
Millisecond Millisecond::getTime()
-throw() {
+{
struct timeval tv;
gettimeofday(&tv, NULL);
Millisecond result(Second(tv.tv_sec));
}
timeval* Millisecond::getTimeVal(timeval& tv) const
-throw() {
+{
if(a_value < 0)
return NULL;
}
string Millisecond::asString() const
-throw() {
+{
string result(functions::asString(a_value));
return result += " ms";
}
//static
Millisecond Millisecond::fromString(const std::string& value)
-throw(RuntimeException) {
+noexcept(false) {
if(value.find(" ms") == string::npos) {
string msg("String: ");
msg += value;