- 477 名前:デフォルトの名無しさん mailto:sage [2008/05/08(木) 15:07:11 ]
- >>475
class my_string : public std::string { bool m_is_null; public: my_string() : m_is_null(true) {} operator=(const char* p) { if (p==NULL) set_null() else set_string(p); } operator=(const std::string& s) { set_string(s); } void set_null() { m_is_null = true; clear(); } void set_string(const std::string& s) { m_is_null = false; *this = s; } bool is_null() { return m_is_null; } }
|

|