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

Is type_string<const int>() == "int" by design #872

Open
2 tasks done
miyanyan opened this issue Dec 31, 2024 · 1 comment · May be fixed by #874
Open
2 tasks done

Is type_string<const int>() == "int" by design #872

miyanyan opened this issue Dec 31, 2024 · 1 comment · May be fixed by #874

Comments

@miyanyan
Copy link

Search before asking

  • I searched the issues and found no similar issues.

What happened + What you expected to happen

win11, msvc2022

expected:

EXPECT_EQ(type_string<int>(), "int");
EXPECT_EQ(type_string<int&>(), "int&");
EXPECT_EQ(type_string<int&&>(), "int&&");
EXPECT_EQ(type_string<const int>(), "const int");
EXPECT_EQ(type_string<const int&>(), "const int&");
EXPECT_EQ(type_string<const int&&>(), "const int&&");

what happend:
lose const

type_string<int>() == "int"
type_string<int&>() == "int&"
type_string<int&&>() == "int&&"
type_string<const int>() == "int"
type_string<const int&>() == "int&"
type_string<const int&&>() == "int&&"

Reproduction way

Anything else

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@qicosmos
Copy link
Collaborator

qicosmos commented Jan 2, 2025

Thanks for your report.
I think it's a bug, welcome to contribute a PR.

@miyanyan miyanyan linked a pull request Jan 2, 2025 that will close this issue
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 a pull request may close this issue.

2 participants