12 Overloading [over]| eel.is
18 Concepts library [concepts]| eel.is
7 Expressions [expr]| eel.is
7.3.1 General [conv.general]| eel.is
7 Expressions [expr]| eel.is
Sometimes you want to add an implicit conversion to a type. This can be done by adding an implicit conversion operator. For example, std::string is implicitly convertible to std::string_view: class string { // template omitted for simplicity public: operator std::string_view() const noexcept { return std::string_view(c_str(), size()); } }; The conversion is safe, cheap, and std::string and std::string_view represent the same platonic value — we match Tony van Eerd’s criteria for impli...| www.foonathan.net