4 ms·
The macro trick is at https://github.com/philsquared/Catch/blob/785db43bb2cd64bfe795ba1c6adef8b82b85430d/include/internal/catch_capture.hpp#L31 https://github.c
by andralex 12y ago
The macro trick is at https://github.com/philsquared/Catch/blob/785db43bb2cd64bfe795ba1c6adef8b82b85430d/include/internal/catch_capture.hpp#L31 https://github.com/philsquared/Catch/blob/785db43bb2cd64bfe7...: planting the tested expression to the right of an operator ->*, which is overloadable and allows for changing the type of the left hand side in the comparison. The rest is a "simple matter of programming". Clever but probably a bit cute - errors would look weird if the expression isn't set up as expected.
- ximeng 12y agoAlso uses template to overload operator ->* https://github.com/philsquared/Catch/blob/785db43bb2cd64bfe795ba1c6adef8b82b85430d/include/internal/catch_result_builder.h https://github.com/philsquared/Catch/blob/785db43bb2cd64bfe7...