How to impliment IVector<T> interface that impliments INumber<T>? #90061
Unanswered
Shadowblitz16
asked this question in
Q&A
Replies: 1 comment 3 replies
-
You wouldn't define all the different versions of You'd likely define something like this instead: public interface IVectorMultiplyOperators<TSelf, T> : IMultiplyOperators<TSelf, TSelf, TSelf>
where TSelf : IVectorMultiplyOperators<TSelf, T>
where T : INumber<T>
{
static abstract TSelf operator *(TSelf left, T right);
} Users who want to multiply a vector by a scalar would then need to constrain to Typical types are |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How would one go about implementing a IVector interface?
I have ran into many problems while doing so.
For example I could not figure out how to do something like this...
Beta Was this translation helpful? Give feedback.
All reactions