feat: drop C++11 support, require C++14 or newer - #6149
Draft
henryiii wants to merge 3 commits into
Draft
Conversation
The C++14 code paths become unconditional: std alias templates, std::make_index_sequence, lambda init-captures in py::init factories, [[deprecated]], and overload_cast. The CMake interface now requires cxx_std_14, setup_helpers rejects cxx_std below 14, and CI C++11 jobs move to C++14. Assisted-by: ClaudeCode:claude-fable-5
- ReadableFunctionSignature: use return type deduction, removing the PYBIND11_READABLE_FUNCTION_SIGNATURE_EXPR macro duplication. - constexpr_first/constexpr_last: use relaxed constexpr loops, removing the constexpr_impl recursion helpers. - constexpr_sum: one loop implementation, removing the __cpp_fold_expressions branch. - Use std::make_unique where the type is unchanged. - Replace 'typename std::X<...>::type' with the C++14 'std::X_t<...>' alias templates. Assisted-by: ClaudeCode:claude-fable-5
…nsparent-functors Both checks require the new C++14 minimum. Assisted-by: ClaudeCode:claude-fable-5
Collaborator
|
Doesn't really seem as worth it compared to CPP17 update |
Collaborator
Yeah, the "unshackling" aspect really only comes with dropping CPP14, too. But I'm still highly supportive of this work, as a stepping stone. When dropping CPP11 is done, we should evaluate if we want a release before also dropping CPP14, or plow through. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Description
Drops C++11 support, making C++14 the minimum. This is the smaller subset of #6124 (which also drops C++14).
First commit removes the C++11 code paths:
detail/common.hgets a clear#errorbelow C++14; the hand-rolledenable_if_t-style aliases and the recursivemake_index_sequenceimplementation are replaced with thestdversions;overload_castand[[deprecated]]become unconditional; Intel minimum is now v19 (v18 was kept only for C++11).detail/init.hfactories always use lambda init-captures (move instead of copy).cxx_std_14on the interface target;setup_helpersrejectscxx_stdbelow 14; CI C++11 jobs move to C++14. Two cmake-build tests verify a consumer requesting C++11 is promoted.Second commit simplifies internals with C++14 features: return type deduction removes the
PYBIND11_READABLE_FUNCTION_SIGNATURE_EXPRmacro, relaxed-constexpr loops replace theconstexpr_implrecursion helpers and the__cpp_fold_expressionssplit inconstexpr_sum,std::make_uniqueand thestd::*_talias templates are used where the meaning is unchanged.conduit/is intentionally untouched (stays C++11-compatible), as is thefunc_wrapperextension point.Third commit enables the clang-tidy checks
modernize-make-uniqueandmodernize-use-transparent-functors(both need C++14) and applies the fixes in the headers and tests.Suggested changelog entry:
📚 Documentation preview 📚: https://pybind11--6149.org.readthedocs.build/