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

fix template disambiguation syntax on MSVC #2799

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PerretB
Copy link
Contributor

@PerretB PerretB commented Jul 22, 2024

MSCV currently emits a syntax error on line (TBB with SIMD branch)

res_stepper.template store_simd(fct_stepper.template step_simd<value_type>());

Adds a simple syntax helper for MSVC (not sure what the standard says here).

res_stepper.template store_simd<>(fct_stepper.template step_simd<value_type>()); 

FIXES #2736 (note that compiling with /Zc:lambda on MSVC is currently required to avoid this compiler bug https://developercommunity.visualstudio.com/t/lambda-fails-to-implicitly-capture-constexpr-value/610504 )

@spectre-ns
Copy link
Contributor

I've been wondering how to fix this. The default lambda parser is definitely not compliant with constexpr captures. How did you know that adding <> would fix this?

@PerretB
Copy link
Contributor Author

PerretB commented Jul 24, 2024

I had a vague memory of having encountered a similar problem with the template keyword before, but I can't say I knew it would work :D

@spectre-ns
Copy link
Contributor

Thanks! This will help my code base.

@JohanMabille please review! 🙂

@brccabral
Copy link

Hi,
Line 1177 has the same .template usage. For my project this change solved the error.

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.

[Bug] Fails to compile with TBB and XSIMD enabled
3 participants