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.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h
index 781a4ab731..2e4c0de28f 100644
--- a/indra/llcommon/llunit.h
+++ b/indra/llcommon/llunit.h
@@ -74,10 +74,21 @@ struct LLUnit
return mValue;
}
+ void value(storage_t value)
+ {
+ mValue = value;
+ }
+
+ template<typename NEW_UNIT_TYPE>
+ storage_t valueInUnits()
+ {
+ return LLUnit<storage_t, NEW_UNIT_TYPE>(*this).value();
+ }
+
template<typename NEW_UNIT_TYPE>
- STORAGE_TYPE valueAs()
+ void valueInUnits(storage_t value)
{
- return LLUnit<STORAGE_TYPE, NEW_UNIT_TYPE>(*this).value();
+ *this = LLUnit<storage_t, NEW_UNIT_TYPE>(value);
}
void operator += (storage_t value)