Open gouarin opened 7 years ago
Using cling via xeus-cling in a juptyer notebook, the following workaround did it for me:
#define INSERTION_OPERATOR operator<< // Workaround for a bug of cling
std::ostream & INSERTION_OPERATOR( std::ostream & os, const Vector2 & v )
{
os << "(" << v.x() << ", " << v.y() << ")";
return os;
}
#undef INSERTION_OPERATOR
Putting the operator implementation inside a namespace
also seems to do the trick
namespace test
{
std::ostream & operator<<( std::ostream & os, const Vector2 & v )
{
os << "(" << v.x() << ", " << v.y() << ")";
return os;
}
}
Just experienced the same issue when using in jupyter xeus-cling notebook, error still exists. Any plans to fix it?
This following example doesn't work in cling (tested with cling 3.0 and cling 0.5-dev)