Vladimir Prus wrote:
Patrick M?zard wrote:
[...]
I think defining operator<< in the same namespace as the class 'Test' is the only way. Otherwise, it won't be found by ADL and ADL is the only way to boost.test to find your operator<<.
Note these workaround do not work or cannot be applied if the type is declared by a typedef. In this case, I have to define again the operator in namespace boost.test_tools.tt_detail.
If the type is declared by a typedef:
typedef foo::C C2;
you can define the operator<< in the 'foo' namespace, and that should work.
That is very unfortunate. Is there no way to have the operator<< lookup occur in the scope of the call to BOOST_CHECK_EQUAL, by moving the wrap_stringstream logic and the call to operator<< into the macro itself ? Cheers, Ian