C++11: explicit Conversion Operators

Image

As of C++11, similar to declaring single-argument constructors explicit, you can declare conversion operators explicit to prevent the compiler from using them to perform implicit conversions. For example, the prototype:

explicit MyClass::operator char *() const;

declares MyClass’s char * cast operator explicit.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.138.178