Make BenchId Movable and Copyable#6491
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Pull request overview
This PR updates the std.benchmark API so that BenchId can be freely stored and passed around in value containers (e.g., List, Tuple) by making it conform to Movable and Copyable, addressing the ergonomics issue raised in #6490.
Changes:
- Make
BenchIdimplementCopyable,ImplicitlyCopyable, andMovableto support use in common value-based collections/aggregates.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JoeLoser
left a comment
There was a problem hiding this comment.
Hi there! 👋
Thanks for the contribution. I left a few comments to check out before we merge this.
|
|
||
| @fieldwise_init | ||
| struct BenchId: | ||
| struct BenchId(Copyable, ImplicitlyCopyable, Movable): |
There was a problem hiding this comment.
Question Do we need the ImplicitlyCopyable or is the explicit copying just fine?
Do you mind adding a test case for this? Something like constructing a List[BenchId] and show copying them works fine.
|
While adding the test case I also thought about adding |
Summary
BenchIdnow implements theMovableandCopyabletrait.Closes #6490
Testing
Ran the benchmark tests via
./bazelw test ////mojo/stdlib/benchmarks/...Checklist
sequence of smaller PRs
./bazelw run formatto format my changesAssisted-by:trailer in my commit message or this PR description(see AI Tool Use Policy)