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 constexpr tuple members where/when required #31

Open
andrewcorrigan opened this issue Apr 13, 2017 · 6 comments
Open

Support constexpr tuple members where/when required #31

andrewcorrigan opened this issue Apr 13, 2017 · 6 comments

Comments

@andrewcorrigan
Copy link
Contributor

#30 is back due to e92ff99

So it looks like the destructor cannot be deleted? How about my original suggestion of __TUPLE_ANNOTATION_DESTRUCTOR, which is the same as __TUPLE_ANNOTATION but without constexpr?

@jaredhoberock
Copy link
Owner

jaredhoberock commented Apr 13, 2017

constexpr should be gone now. It doesn't really make sense to attempt to fold it into __TUPLE_ANNOTATION, because not everything is supposed to be constexpr. I tried to apply constexpr piecemeal, but it looked like a lot of work to figure out under what conditions it needs to be applied. So I just eliminated it for now.

@andrewcorrigan
Copy link
Contributor Author

Thanks for the quick response. However, I was kind of hoping it might be possible to figure out how to make it work, since I think it would be really valuable -- I have a ton of code that theoretically could be made constexpr.

You said you applied it piecemeal, but I naively tried keeping constexpr applied everywhere except the destructor, and that appears to be working in my code at least at a basic level. Did even that fail for you?

@jaredhoberock
Copy link
Owner

Many of std::tuple's members are constexpr only in C++14 or better: http://en.cppreference.com/w/cpp/utility/tuple/tuple

It looks like the constructor alone has 18 different versions. Making sense of all that just seems like it will require more effort than I'm prepared to expend right now.

@andrewcorrigan
Copy link
Contributor Author

That list of constructors is intimidating... Anyway, thanks again.

@jaredhoberock
Copy link
Owner

We can leave this open to track the issue.

@jaredhoberock jaredhoberock reopened this Apr 14, 2017
@jaredhoberock jaredhoberock changed the title destructor cannot be marked constexpr is back Support constexpr tuple members where/when required Apr 14, 2017
@andrewcorrigan
Copy link
Contributor Author

Oh great, I thought you were implying this was "wontfix". I'll be testing it with constexpr in C++14, and will report any issues I encounter here.

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