einpoklum
einpoklum

Reputation: 132310

Should I provide ostream << operators for types in a library?

I'm working on a C++ wrapper library for some API. Suppose I've implemented some struct or class type Foo. I can't make up my mind whether or not to provide an ostream& operator<<(ostream& os, const Foo& x) with my library.

On one hand:

On the other hand:

Am ignoring some other primal consideration for any of the options? Or, to put it different: What would be an appropriate criterion for including such operators with the library?

Additional info:

Upvotes: 5

Views: 151

Answers (0)

Related Questions