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

Get rid of recursive template instantiations for concatenating type signatures on C++17 and higher #4587

Merged

Conversation

k-bespalov
Copy link
Contributor

Description

I have had the same error as #1828 when tried to compile big class with a lot of properties and methods with a big number of arguments. I had this issue compiling C++17 standard on MSVC. Unlike GCCs(-ftemplate-depth), for example, MSVC does not have the ability to configure the depth of template instantiation, and on large and complex classes, the compiler's limit can be reached. Since C++17 recursive implementation of concat function can be replaced with fold expression. This change has helped me in my case.

Suggested changelog entry:

* Get rid of recursive template instantiations for concatenating type signatures on C++17 and higher.

@rwgk
Copy link
Collaborator

rwgk commented Mar 24, 2023

Looks great!
Could you please fix the pre-commit failure?
The auto-push didn't work, see error message under the Details link.

@k-bespalov k-bespalov force-pushed the get_rid_of_recursion_in_concat_function branch from b979264 to ac3e70b Compare March 24, 2023 00:18
@k-bespalov
Copy link
Contributor Author

Looks great! Could you please fix the pre-commit failure? The auto-push didn't work, see error message under the Details link.

Hi, thanks!
Code formatting has been fixed.

@rwgk
Copy link
Collaborator

rwgk commented Mar 24, 2023

I'm totally convinced the one failed job (🐍 pypy-3.7 • windows-2022 • x64) is a flake unrelated to this PR. I'm rerunning it anyway to clearly rule out any doubts.

@rwgk
Copy link
Collaborator

rwgk commented Mar 24, 2023

Thanks for figuring this out!

@rwgk rwgk merged commit 5bbcba5 into pybind:master Mar 24, 2023
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Mar 24, 2023
rwgk pushed a commit to rwgk/pybind11 that referenced this pull request Mar 24, 2023
rwgk pushed a commit that referenced this pull request Mar 24, 2023
* use C++17 syntax to get rid of recursive template instantiations for concatenating type signatures (#4587)

* Apply descr.h `src_loc` change (smart_holder PR #4022) to code added with master PR #4587

* Add test_class_sh_property_non_owning to CMakeLists.txt (fixes oversight in PR #4586)

* Resolve clang-tidy errors.

* clang-tidy auto fix

---------

Co-authored-by: Konstantin Bespalov <kos5tya@yandex.ru>
Skylion007 added a commit to Skylion007/pybind11 that referenced this pull request Mar 27, 2023
@Skylion007
Copy link
Collaborator

FYI, updated the feature testing macro to better match elsewhere in the codebase in a follow up PR #4592.

@SanPen
Copy link

SanPen commented Apr 18, 2023

I'm still getting the error under 2.10.4 (assuming that release got this change)

@k-bespalov k-bespalov deleted the get_rid_of_recursion_in_concat_function branch April 18, 2023 20:44
@k-bespalov
Copy link
Contributor Author

k-bespalov commented Apr 18, 2023

I'm still getting the error under 2.10.4 (assuming that release got this change)

Hi,
No, it didn't. The version containing this change hasn't been released yet.

@rwgk do you have any estimates regarding new version release date?

@rwgk
Copy link
Collaborator

rwgk commented Apr 18, 2023

@henryiii has been doing the releases.

Could/should we cut a 2.10.5 release?

@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label May 22, 2023
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.

4 participants