Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: C++
Posted by: Jose Fernando Lopez Fernandez
Added: May 31, 2018 1:44 AM
Modified: May 31, 2018 1:45 AM
Views: 8
This is a standard output stream operator overloading for a generic (non-templated) class.

Edit: shortened to single line statement.
  1. friend std::ostream& operator<<(std::ostream& outputStream, const <Class>& c) {
  2.     return outputStream << "output";
  3. }
  4.