Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
polskibus
on March 12, 2018
|
parent
|
context
|
favorite
| on:
Tuples goodness in .NET 4.7.1
How is this feature implemented, what is the complexity of access via index? Is it O(1)? Also, adding interfaces onto struct and referencing them by interface causes boxing, right? If so, performance benefit of valuetuple is erased.
zamalek
on March 12, 2018
[–]
It is implemented with a recursive call (if the tuple contains tuples), otherwise, it's a hardcoded constant.
> boxing
You can create a generic function that accepts T where T: ITuple to eliminate this cost.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: