Closed ooxi closed 1 year ago
I was most likely looking for Custom Representation Types. Will reopen this ticket if my experiments fail.
Hi, sure, custom representation types are supported. There are a few examples in the repository already:
For the last few days, I have been working on improving the concepts and requirements for representation types, but it will take me a while because I want to improve support for vector and tensor quantities as well.
This is how you can make your example work: https://godbolt.org/z/M8E49Po3P
Please note that there is no documentation (besides README) for V2 for now. I will be working on it in the upcoming weeks.
Thank you very much @mpusz!
template<size_t I, size_t F>
inline constexpr bool mp_units::is_scalar<numeric::fixed<I, F>> = true;
This was what I was missing in order to make it work without too much clutter.
In case you would also like to use this representation type with vector or tensor quantities, you should also specialize traits for them.
We would like to use mp-units in our embedded product with fixed point math:
However, it seems like operator overloads are missing (see Compiler Explorer):
I therefore have the following questions: