microsoft / STL

MSVC's implementation of the C++ Standard Library.
Other
9.89k stars 1.45k forks source link

Workaround for the interaction of constraints in `expected` and explicit template instantiation in permissive modes #4658

Closed frederick-vs-ja closed 1 month ago

frederick-vs-ja commented 1 month ago

Fixes #4657. ~Works around DevCom-10652420~, which is closed as Not a Bug. Works around /permissive-.

Also adds test coverage for expected in permissive modes.

StephanTLavavej commented 1 month ago

Thanks - a good workaround for a disgusting mode! :vomiting_face: :joy_cat:

I explored whether requires requires { MEOW.swap(PURR); } would help by itself, but it doesn't - possibly workarounds would need to be added to member swap in that case. I didn't care enough, so I abandoned the attempt for now.

StephanTLavavej commented 1 month ago

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

StephanTLavavej commented 1 month ago

Thanks again for investigating and fixing this bug! :hammer_and_wrench: :rocket: :lady_beetle: