We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I suggest to remove minusAssign/plusAssign operators from public API of AtomicInt and AtomicLong.
minusAssign
plusAssign
AtomicInt
AtomicLong
addAndGet
Not the reasons to remove the API, but related problems:
Alternative solution is to solve the problems above and keep the API. And of course it's more convenient to write:
private val x = atomic(0) x -= 5
vs
private val x = atomic(0) x.addAndGet(-5)
@fzhinkin WDYT? 👀
The text was updated successfully, but these errors were encountered:
IMO the operator functions feel more natural. And I can swap an atomic with a normal number type (and vice-versa) without changes.
People working with Kotlin should be aware of operator functions, and the IDE provides navigation to the target in case one wants to explore the code.
Sorry, something went wrong.
That's a good point, right.
These operators will be supported in the atomicfu compiler plugin for the future Kotlin versions: KT-67839
No branches or pull requests
I suggest to remove
minusAssign
/plusAssign
operators from public API ofAtomicInt
andAtomicLong
.addAndGet
instead.Not the reasons to remove the API, but related problems:
Alternative solution is to solve the problems above and keep the API.
And of course it's more convenient to write:
vs
@fzhinkin WDYT? 👀
The text was updated successfully, but these errors were encountered: