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

Popular posts from this blog

angularjs - Redirect to a new template in angular js -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

Desktop Launcher for Python Script Starts Program in Wrong Path (Linux) -