generic updates with addition operator #3997
Unanswered
LolaLollipop
asked this question in
Q&A
Replies: 1 comment
-
I generally advice people not to try writing this kind of generic code for their applications as you end up with a pretty hard to maintain number of trait bounds if you get it to work. That's also the reason why I don't provide help figuring out these kind of trait bounds. Sorry, but you are on your own there if you want to truly go down that way. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i want to do a generic update but also use the addition operator (to increment), my code so far looks like:
the problem is that it's erroring at the +, saying that i can't add an
X
to an{integer}
. i've tried adding:as a bound but this doesn't seem to work, and just generates a more complex issue.
what's the best way to write this so that i can increment it?
Beta Was this translation helpful? Give feedback.
All reactions