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

[cpp] Add white space around template type syntax #11107

Merged
merged 2 commits into from Apr 9, 2023

Conversation

Aidan63
Copy link
Contributor

@Aidan63 Aidan63 commented Apr 9, 2023

You learn something fun new every day. Add white space around C++ template types to prevent it being interpreted as a digraph when the C++ standard is less than 11.

@Aidan63 Aidan63 changed the title Add white space around template type syntax [cpp] Add white space around template type syntax Apr 9, 2023
@jeremyfa
Copy link

jeremyfa commented Apr 9, 2023

It seems the leading space is the only one necessary, given what I've seen in existing hxcpp code base

@Aidan63
Copy link
Contributor Author

Aidan63 commented Apr 9, 2023

yeah, thats what I read online as well. I'm just paranoid about odd features in old C++ standards now... Extra white space can't hurt? Right?

@jeremyfa
Copy link

jeremyfa commented Apr 9, 2023

Extra white space can't hurt? Right?

You never know 😆.

Anyway I'm just thinking using only the leading space would be more consistent to the existing workarounds I've seen, but yeah it probably doesn't hurt to have the trailing one as well, as long as it compiles fine...

@Simn
Copy link
Member

Simn commented Apr 9, 2023

I think I usually see only the leading space, not the trailing one. So I guess we should stick to that, especially if that's what hxcpp has been doing.

@Aidan63
Copy link
Contributor Author

Aidan63 commented Apr 9, 2023

I've removed the trailing whitespace after the comma in the type parameter list but kept the space preceeding the closing ">", so generic externs are now consistent with the code Array, FastInterator, Pointer, and a few other templated types generates.

@Simn Simn merged commit 4b15580 into HaxeFoundation:development Apr 9, 2023
49 checks passed
@Simn Simn mentioned this pull request Apr 9, 2023
5 tasks
@Aidan63 Aidan63 deleted the cpp-avoid-digraphs branch April 9, 2023 11:35
kLabz pushed a commit that referenced this pull request Apr 11, 2023
* Add white space around template type syntax

* removed trailing whitespace after comma in type parameter list
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.

None yet

3 participants