#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
class Test
{
public:
Test() { m_int = 0; contents ="hello qsd~!/n";access_ctr = 0; }
~Test(){};
protected:
private:
int m_int;
string contents;
mutable size_t access_ctr;
public:
Test& move();
Test& display(ostream& os)
{ do_display(os); return *this;}
const Test& display(ostream& os) const
{ do_display(os); return *this;}
private:
void do_display(ostream& os) const
{ os<<contents; os<<++access_ctr ;}
};
inline Test& Test::move()
{
m_int++;
return *this;
}
int main()
{
Test t1;
const Test ct1;
t1.move().display(cout);
ct1.display(cout);
getch();
return 0;
}
//hello qsd~!
//1hello qsd~!
//1