-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
Use constexpr for basic_string #964
base: master
Are you sure you want to change the base?
Conversation
I'm pretty sure that this should work for C++14 constexpr, unless you know of any C++17/20 features that are required. Also, you have not created any unit tests to check that all of the constexpr functions can be used in a constexpr expression. |
Right,
What would be the purpose of such tests? This wouldn't really test a functionality, either the function isn't marked as |
The purpose of the |
Isn’t that granted by the c++ standard directly? I cannot really think of a case this isn’t true. |
Certain compilers will only analyse the template code for what you actually invoke. For example, Microsoft's compiler will not alert that a template function cannot be used in a Example:
|
What about the constexpr support for the top level classes |
The unit tests fail for C++11. |
This pull request intends to align the use of
constexpr
with how it is defined for `std::basic_string' in the STL.