[Positioning] Add Point3D::operator bool()

This commit is contained in:
Matteo Cypriani 2011-05-04 18:16:10 +02:00
parent 6c3647410d
commit 1bb589b460
2 changed files with 14 additions and 0 deletions

View File

@ -117,6 +117,19 @@ Point3D::operator string(void) const
}
/**
* @return \em true if either #x, #y or #z is non-zero.
* @return \em false if #x, #y and #z are defined to 0.
*/
Point3D::operator bool(void) const
{
return
x != 0 &&
y != 0 &&
z != 0 ;
}
ostream& operator<<(ostream &os, const Point3D &p)
{

View File

@ -72,6 +72,7 @@ public:
bool operator>(const Point3D &source) const ;
bool operator<=(const Point3D &source) const ;
bool operator>=(const Point3D &source) const ;
operator bool(void) const ;
operator std::string(void) const ;
//@}