The README mentions unit_t::to<T> and unit_cast<T> for accessing the underlying value as T. However the implementation of these seem to be using static_cast<T> internally, and (due to an unit_t::operator T() I guess?) it works externally too.
Is using static_cast for accessing the underlying value considered non-idiomatic? Are there any pitfalls I should be aware of when using static_cast?
The README mentions
unit_t::to<T>
andunit_cast<T>
for accessing the underlying value asT
. However the implementation of these seem to be usingstatic_cast<T>
internally, and (due to anunit_t::operator T()
I guess?) it works externally too.Is using static_cast for accessing the underlying value considered non-idiomatic? Are there any pitfalls I should be aware of when using static_cast?