From fb06a3ec2f55c71b4736d53892c07fd6abd7d595 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 24 Mar 2015 02:43:43 +1100 Subject: [PATCH] extent: move aspect calculation back into object --- extent.hpp | 7 +++---- extent.ipp | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/extent.hpp b/extent.hpp index 0c84c251..11785cb4 100644 --- a/extent.hpp +++ b/extent.hpp @@ -40,6 +40,9 @@ namespace util { T area (void) const; T diameter (void) const; + template + U aspect (void) const; + extent expanded (vector) const; extent expanded (T) const; @@ -52,10 +55,6 @@ namespace util { static const extent MIN; }; - template - U - aspect (extent<2,T>); - typedef extent<2,int> extent2i; typedef extent<2,size_t> extent2u; typedef extent<2,float> extent2f; diff --git a/extent.ipp b/extent.ipp index b7d12a05..17c1d07a 100644 --- a/extent.ipp +++ b/extent.ipp @@ -39,9 +39,10 @@ util::extent::cast (void) const //----------------------------------------------------------------------------- -template +template +template U -util::aspect (util::extent<2,T> e) +util::extent::aspect (void) const { - return static_cast (e.w) / e.h; + return static_cast (this->w) / this->h; }