Skip to content

Conversation

@Tasemo
Copy link

@Tasemo Tasemo commented Jun 12, 2023

Uses std::function instead of function pointers for the callback provided with ComputeStatistics(), if C++11 is used. This allows for greater flexibility as the user can use closures, member functions, bind expressions, etc. This should be a non API breaking change as std::function implicitly stores function pointers as well.

Closes #1604. Instead of a dedicated function, all the values can now be aggregated by the user. This should be the easier change.

@LebedevRI
Copy link
Collaborator

I'm not sure this is that simple.

If library is used (not compiled!) by C++03 code,
object compute_ in Statistics type would be a pointer,
but once Statistics is passed into the library's internals,
it will silently become a different Statistics type,
one where compute_ object is suddenly a std::function.
But std::function was never constructed?

@Tasemo
Copy link
Author

Tasemo commented Jun 12, 2023

Ah you are right, good catch. I'll be using my fork then until support for C++03 is dropped (it has been 20 years).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Aggregated statistics for all threads in a benchmark

2 participants