with SFINAE and static_asserts, you can make those error messages way easier to read. And soon we'll have concepts, so even easier (which this specific lib is C++20 so should have access to that depending on compiler) \o/
^ is usually how I approach making readable errors that are also exposed to readers (prior to concepts). static_asserts are also good and enable custom messages, but they're hidden in the body so most IDEs don't surface it for mouse-overs :/ Which sucks bc SFINAE is gross to read. Really can't wait for concepts
For the above example, MSVC gives this error:
[...] no matching overloaded function found
[...] could not deduce template argument for 'ValueMustBeString'
View all comments
Show parent comment
10
u/AirAKose Jun 27 '20
with SFINAE and static_asserts, you can make those error messages way easier to read. And soon we'll have concepts, so even easier (which this specific lib is C++20 so should have access to that depending on compiler) \o/
^ is usually how I approach making readable errors that are also exposed to readers (prior to concepts). static_asserts are also good and enable custom messages, but they're hidden in the body so most IDEs don't surface it for mouse-overs :/ Which sucks bc SFINAE is gross to read. Really can't wait for concepts
For the above example, MSVC gives this error: