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

Support for different types in problemSpace array. #21

Closed
danielsaad opened this issue Apr 21, 2014 · 4 comments
Closed

Support for different types in problemSpace array. #21

danielsaad opened this issue Apr 21, 2014 · 4 comments

Comments

@danielsaad
Copy link

Hello! Thank you for the support. Celero is being very helpful.

It would be nice if getExperimentValues() was a templated method. Thus, the problemSpace array could be parameterized in compile time by using templates.

Another option would be making the problemSpace some kind of map data structure, which maps a integer to a structure representing the input of the benchmark test.

In my opinion, this would give more flexibility in the setUp methods.

@DigitalInBlue
Copy link
Owner

This is a good idea. I don't like that it only takes int64_t's either. I think it could easily be a templated parameter on a test fixture. Then you would have a std::vector to work with for your problemSpace. Would that address your needs?

@danielsaad
Copy link
Author

Absolutely. :)

@DigitalInBlue
Copy link
Owner

So I looked at this and it wouldn't be trivial to shoe-horn in. I agree it would be a nice feature. I would suggest you could push indexes into the array, 0-N, and then use that in your own map or as indexes into a vector of objects or whatever you may need. It's a bit of a hack, but not too much of one for now. Hope that helps.

@danielsaad
Copy link
Author

That is okay for now :)
A unordered_map from stl suffices to do this little hack.

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

No branches or pull requests

2 participants