summaryrefslogtreecommitdiff
path: root/indra/llcommon/llunit.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llunit.h')
-rw-r--r--indra/llcommon/llunit.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h
index 9d78df7cae..52b837fdc3 100644
--- a/indra/llcommon/llunit.h
+++ b/indra/llcommon/llunit.h
@@ -44,13 +44,19 @@ struct LLUnit : public BASE_UNIT
: BASE_UNIT(convertToBase(value))
{}
- operator value_t() { return get(); }
+ operator value_t() { return value(); }
- value_t get() const
+ value_t value() const
{
return convertToDerived(mValue);
}
+ template<typename CONVERTED_TYPE>
+ value_t value() const
+ {
+ return CONVERTED_TYPE(*this).value();
+ }
+
static value_t convertToBase(value_t derived_value)
{
return (value_t)((F32)derived_value * DERIVED_UNIT::conversionToBaseFactor());
@@ -84,7 +90,7 @@ struct LLUnit<T, T>
return *this;
}
- value_t get() { return mValue; }
+ value_t value() { return mValue; }
static value_t convertToBase(value_t derived_value)
{