
22 Jan
2014
22 Jan
'14
12:14 p.m.
On 22 January 2014 12:11, Mathias Gaunard
On 22/01/14 11:52, Alexander Lamaison wrote:
BOOST_TEST(a <operator> b), however, cleverly parses a, b and <operator> from the macro and does something like
bool x = (a <operator> b) BOOST_CHECK_MESSAGE_IMPL(x, "a must be <operator> to b", a, b);
What sort of magic allows to parse a <operator> b, and how reliable is it in the real world?
BTW, I haven't looked into Boost.Test code, but this reminds me expression capture and decomposition technique used in Catch library https://github.com/philsquared/Catch/blob/master/include/internal/catch_capt... (not sure if this is the only file involved) AFAICT, it works really nice in Catch. Best regards, -- Mateusz Łoskot, http://mateusz.loskot.net