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

Non-constexpr TIMES #283

Open
Swassie opened this issue Oct 22, 2022 · 5 comments
Open

Non-constexpr TIMES #283

Swassie opened this issue Oct 22, 2022 · 5 comments

Comments

@Swassie
Copy link

Swassie commented Oct 22, 2022

Hey

Currently the TIMES macro requires that its argument must be constexpr. This makes it not possible to use in a parametrized test or helper function where the number of calls depends on some parameter.

What is the reason behind this limitation, and can it be removed?

Thanks

@rollbear
Copy link
Owner

The reason is that the limits are expressed in the type system, and are used for many compile time checks. It may be possible to make it a runtime limit, probably with somewhat worse compile time error discovery, but it would be a substantial change.

@Swassie
Copy link
Author

Swassie commented Oct 22, 2022

I think it would be a good change, especially since the workarounds (e.g. counter variables) aren't very good. The code would be cleaner and easier to understand if TIMES could be used in both cases.

@rollbear
Copy link
Owner

PR is welcome. I think it may be possible, but I don't know how to just yet.

@Swassie
Copy link
Author

Swassie commented Oct 22, 2022

Sure, I can give it a try.

@DNKpp
Copy link
Contributor

DNKpp commented Nov 14, 2023

I'm giving this a bump, as I would really love to see this to be possible.

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

3 participants