Explicit operator bool() for int64x64_t

This commit is contained in:
Peter D. Barnes, Jr
2022-03-25 11:03:48 -07:00
committed by Tom Henderson
parent 7617186e8f
commit e2ee75cd5a
3 changed files with 20 additions and 2 deletions

View File

@@ -217,6 +217,12 @@ public:
return *this;
}
/** Explicit bool conversion. */
inline explicit operator bool () const
{
return (_v != 0);
}
/**
* Get this value as a double.
*

View File

@@ -198,6 +198,12 @@ public:
return *this;
}
/** Explicit bool conversion. */
inline explicit operator bool () const
{
return (_v != 0);
}
/**
* Get this value as a double.
*

View File

@@ -112,7 +112,7 @@ public:
: _v (v)
{}
inline int64x64_t (long long int v)
: _v (static_cast<double> (v))
: _v (static_cast<long double> (v))
{}
inline int64x64_t (unsigned int v)
: _v (v)
@@ -121,7 +121,7 @@ public:
: _v (v)
{}
inline int64x64_t (unsigned long long int v)
: _v (static_cast<double> (v))
: _v (static_cast<long double> (v))
{}
/**@}*/
/**
@@ -161,6 +161,12 @@ public:
return *this;
}
/** Explicit bool conversion. */
inline explicit operator bool () const
{
return (_v != 0);
}
/**
* Get this value as a double.
*