#include <iostream>
#include <iomanip>
using namespace std;
class S {
private:
	string strName;
	char point;
public:
	S() : strName(""), point('\0') {}
	S(const string& cstrName, char p) : strName(cstrName), point(p) {}
	// operator==
	friend bool operator==(char *sz, const S& k) {return k.strName == string(sz);};
	friend bool operator==(char a, const S& k) {return k.point == a;}
	friend bool operator==(const S& a, const S& b) {return a.strName == b.strName && a.point == b.point;}
	bool operator==(const S& a) const {return strName == a.strName && point == a.point;}
	bool operator==(const char *k) const {return strName == string(k);}
	bool operator==(char k) const {return point == k;}
	// operator=
	//13.5.3 Assignment [over.ass]
	//1 An assignment operator shall be implemented by a non-static member function with exactly one parameter.
	// S& operator=(char k){point = k; cout << "inline";return *this;};
	S& operator=(char c){point = c; return *this;};
	S& operator=(char *k){strName = string(k); return *this;};
	S& operator=(S& a) {strName = a.strName;point = a.point;  return *this;}
	friend ostream& operator<<(ostream& os, const S& s)
		{
		os << "Name: " << s.strName << "\nPoint: " << s.point;
		return os;
		}
	};
int main()
{
S a("Hello World!", '.');
cout << "\nConstruction " << endl;
cout << a << endl;
cout << "\nAssigning char value: >>>,<<<" << endl;
a = ',';
cout << a << endl;
cout << "\nAssigning char* value: >>>New World<<<" << endl;
char c[] = "New World";
a = c;
cout << a << endl;

return 0;
}