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

Adding constexpr to intrusive containers #840

Closed
wants to merge 2 commits into from
Closed

Conversation

ZachOB
Copy link

@ZachOB ZachOB commented Feb 10, 2024

Adding constexpr to the intrusive containers. I was able to build and run tests for c++11, 14, and 17. c++20 had some issues with char8_t so I was unable to run those. c++03 was very broken for me but ETL_CONSTEXPR should be pre-compiled away so I don't think this could have broken anything.

Copy link

Review changes with SemanticDiff.

@jwellbelove
Copy link
Contributor

You need to create new unit tests to test that the use of the constexpr changes compile and work correctly.

@ZachOB
Copy link
Author

ZachOB commented Feb 15, 2024

Looks like my use of constexpr was a little more hopeful than useful.

Both intrusive_list and intrusive_forward_list are not literal due to the clear() in their destructors. intrusive_queue and intrusive_stack have no destructors, so can be constexpr, but maybe they should call clear() in their destructors?

The only use I can think of for a constexpr queue/stack is data processing in constexpr functions, as having a standalone constexpr queue or stack seems entirely pointless.

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.

2 participants