Skip to content
New issue

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

Add operator[] to enumerable_thread_specific #608

Open
akukanov opened this issue Jan 16, 2025 · 0 comments
Open

Add operator[] to enumerable_thread_specific #608

akukanov opened this issue Jan 16, 2025 · 0 comments
Labels
enhancement New feature or request TBB

Comments

@akukanov
Copy link
Contributor

Since enumerable_thread_specific accepts random access iteration according to https://oneapi-spec.uxlfoundation.org/specifications/oneapi/v1.4-rev-1/elements/onetbb/source/thread_local_storage/enumerable_thread_specific_cls/iteration, it could be useful to add operator[] directly to the class, in case someone prefers access by an index.

It should probably be said that indexes have no permanent association with threads and thread-specific values, and that the indexes outside of the [0,size()) range are invalid. The method at() can be added as well for an out-of-range exception on invalid access.

@akukanov akukanov added enhancement New feature or request TBB labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request TBB
Projects
None yet
Development

No branches or pull requests

1 participant