If I have a POD with an overloaded stream operator:
struct Value{ ... friend ostream& operator<< (ostream &out, Value &val); ... };
Since the operator should not modify the right operand, it should take it by const reference:
const
friend ostream& operator<< (ostream &out, const Value &val);
const references can bind to temporaries, so it will work (and that's how the standard library does it as well).