c++ - Dangers of using an implicit string conversion operator? -
what dangers of using implicit string
conversion operator in custom string class?
class mystring { public: ... inline operator string() const { return str; } private: std::string str; };
the main "danger" of implicit conversion mostly: might unexpected conversion.
if string class can logically used std::string, not think there problem.
Comments
Post a Comment