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

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -