// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <string>

using namespace std;

class Data
{
private:
    int iv;
    string sv;
public:
    Data(int iv, string sv);
    friend ostream& operator<<(ostream& s, const Data& d);
};

Data::Data(int iv, string sv)
{
    this->iv = iv;
    this->sv = sv;
}

ostream& operator<<(ostream& s, const Data& d)
{
    s << "(" << d.iv << "," << d.sv << ")";
    return s;
}

int main()
{
    Data d(123, "ABC");
    cout << d << endl;
    return 0;
}
    
