-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Clarify the difference between BENCHMARK_TEMPLATE_F
and BENCHMARK_TEMPLATE_DEFINE_F
+ BENCHMARK_REGISTER_F
#1815
Conversation
Add comments highlighting the difference between `BENCHMARK_TEMPLATE_F` and `BENCHMARK_TEMPLATE_DEFINE_F`, mirroring those of `BENCHMARK_F ` and `BENCHMARK_DEFINE_F`.
docs/user_guide.md
Outdated
@@ -665,7 +665,9 @@ BENCHMARK_TEMPLATE_DEFINE_F(MyFixture, DoubleTest, double)(benchmark::State& st) | |||
} | |||
} | |||
|
|||
/* DoubleTest is NOT registered */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think //
-style comments are used elsewhere, so let's be consistent.
I think it would be good to also mention IntTest
,
is BENCHMARK_TEMPLATE_F
enough, and only the BENCHMARK_TEMPLATE_DEFINE_F
needs to be followed up with BENCHMARK_REGISTER_F
or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍, I'm happy to do that (and will write some tests to confirm!).
In the user guide, Fixtures is similar and uses /* ... */
comments - I think it's within scope to update that one.
Shall I update the one other instance in Preventing Optimization as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍, I'm happy to do that (and will write some tests to confirm!).
In the user guide, Fixtures is similar and uses
/* ... */
comments - I think it's within scope to update that one.Shall I update the one other instance in Preventing Optimization as well?
Eh, i guess why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. PTAL.
BENCHMARK_TEMPLATE_F
and BENCHMARK_TEMPLATE_DEFINE_F
+ BENCHMARK_REGISTER_F
Seems nice to me. I did not verify that the behavior of |
great. thank you! |
Add comments highlighting the difference between
BENCHMARK_TEMPLATE_F
andBENCHMARK_TEMPLATE_DEFINE_F
, mirroring those ofBENCHMARK_F
andBENCHMARK_DEFINE_F
.