martinus / nanobench

Simple, fast, accurate single-header microbenchmarking functionality for C++11/14/17/20
https://nanobench.ankerl.com
MIT License
1.43k stars 82 forks source link

Add support for custom information per benchmark run #77

Closed jonas-schulze closed 1 year ago

jonas-schulze commented 1 year ago

Unfortunately, I haven't been able to build and therefore check the docs I wrote.

Also, I saw that some methods are overloaded for char const* and std::string const&. Should Bench::context do the same? What about Result::context?

Do you think context is a feasible name? If not, how should these methods be called?

jonas-schulze commented 1 year ago

Ubuntu hirsute has reached EOL, so I guess the CI failure is ok?

Regardning AppVeyor, I have no experience with Windoes, so don't know how to address the error message. I added a member to Config, which may be the reason, but I wonder why it built just fine on the (recent) Ubuntus.

'ankerl::nanobench::Config::Config(ankerl::nanobench::Config &&) noexcept': is not a special member function which can be defaulted
jonas-schulze commented 1 year ago

about const char* overloads, please add one, and the implementation can just call the std::string version then.

Given that there is a constructor std::string(char const*), this conversion should happen implicitly when calling context(std::string const&,...), shouldn't it? Passing a char const* to it works just fine. I am not opposed to add the overloads, I just want to understand their benefits.

Some more observations:

Is that something that should be addressed?

jonas-schulze commented 1 year ago

I addressed all open issues. This is ready for review again. 🙂

martinus commented 1 year ago

Thanks a lot!