Skip to content

Overloading std::to_string is undefined behavior #180

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

Closed
goldsborough opened this issue Dec 23, 2017 · 1 comment · Fixed by #208
Closed

Overloading std::to_string is undefined behavior #180

goldsborough opened this issue Dec 23, 2017 · 1 comment · Fixed by #208
Assignees

Comments

@goldsborough
Copy link
Contributor

Was browsing the codebase and noticed that we are overloading std::to_string for Glow's Type class. Not to be that guy, but this is undefined behavior as per the standard (only allowed to explicitly specialize templates for user-defined types).

Not sure if we care? If we do, we should probably move that to Type::to_string or something.

Source: https://stackoverflow.com/questions/14402990/should-you-overload-swap-in-the-std-namespace

@nadavrot
Copy link
Contributor

This is a good point. Thanks for catching this Peter. We should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants