Overload * operator for BitRate and Duration#968
Overload * operator for BitRate and Duration#968breckognize wants to merge 3 commits intoangularsen:masterfrom
Conversation
This change adds Information, whose base unit is the bit, to BaseDimensions. This enables a future change to overload the * operator for BitRate that allows for (e.g.) 1 MB/sec * 1 hour = 3600MB.
Separated to make reviewing the previous diff simpler. This can be squashed with the previous change on merge.
This enables expressions of the form 1MB/sec * 1 hour = 3600MB.
|
Hi and thanks for contributing. It seems you hit an edge case here, sorry about that. If you could please try this PR again, you should really only have to add your BitRate.extra.cs file, no other changes should be necessary. Let me know if you still meet a wall. As for the intent behind BaseDimensions, it was an experiment to see if we could support dynamic conversions like BaseDimensions is only intended for SI derived quantities, and as mentioned, it was an experiment we haven't fully explored or reaped the benefits from yet. Other related topics from a quick search Best, Andreas. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The change to overload the * operator for BitRate and Duration is simple, but doing so broke unit tests. To fix them, I needed to make Information a BaseDimension, which is the bulk of the diff. I believe I've done that successfully, but I confess I don't understand why "BaseDimensions" exists. (Does it enable a feature? Does it offer redundancy for testing?)