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

Containers: add explicit StridedDimension conversion from/to external types #162

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

Conversation

mosra
Copy link
Owner

@mosra mosra commented Dec 29, 2022

In addition to the implicit conversion. Desired use case is for types where we still want to have a conversion for convenience purposes, but the conversion is potentially dangerous (such as Magnum's Vector3i -> Size3D).

Fails to compile on MSVC 2019 and earlier due to the compiler thinking the two constructors / conversion operators are the same. 2022 works; all other compilers including GCC 4.8 work as well. The seemingly-conflicting overload is based on the answers in https://stackoverflow.com/questions/14600201/why-should-i-avoid-stdenable-if-in-function-signatures, there isn't any indication of MSVC being the odd one out.

In addition to the implicit conversion. Desired use case is for types
where we still want to have a conversion for convenience purposes, but
the conversion is potentially dangerous (such as Magnum's Vector3i ->
Size3D).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant