diff --git a/extent.cpp b/extent.cpp index 6e163cee..0bba9510 100644 --- a/extent.cpp +++ b/extent.cpp @@ -43,7 +43,8 @@ util::extent::extent (const util::extent &rhs): //----------------------------------------------------------------------------- template util::extent& -util::extent::operator= (const util::extent &rhs) { +util::extent::operator= (const util::extent &rhs) +{ w = rhs.w; h = rhs.h; @@ -54,7 +55,8 @@ util::extent::operator= (const util::extent &rhs) { /////////////////////////////////////////////////////////////////////////////// template T -util::extent::diameter (void) const { +util::extent::diameter (void) const +{ return static_cast (sqrt (w * w + h * h)); } @@ -63,7 +65,9 @@ util::extent::diameter (void) const { template T util::extent::area (void) const - { return w * h; } +{ + return w * h; +} /////////////////////////////////////////////////////////////////////////////// @@ -100,13 +104,16 @@ util::extent::aspect (void) const template bool util::extent::empty (void) const - { return almost_equal (area(), 0); } +{ + return almost_equal (area(), 0); +} /////////////////////////////////////////////////////////////////////////////// template bool -util::extent::operator ==(const extent& rhs) const { +util::extent::operator ==(const extent& rhs) const +{ return almost_equal (w, rhs.w) && almost_equal (h, rhs.h); } @@ -135,7 +142,8 @@ namespace util { /////////////////////////////////////////////////////////////////////////////// template std::ostream& -util::operator<< (std::ostream &os, util::extent e) { +util::operator<< (std::ostream &os, util::extent e) +{ os << "[" << e.w << ", " << e.h << "]"; return os; }