Created
January 12, 2015 12:50
-
-
Save wancw/771bcb03826af0bd8ca6 to your computer and use it in GitHub Desktop.
Revisions
-
wancw created this gist
Jan 12, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ class To{}; #include <utility> class From{ public: /* This will cause compilation error under Clang (3.5) with c++11 standard */ operator const To() { return To(); } /* Any one of below works fine */ //explicit operator const To() { return To(); } //operator To() { return To(); } //operator To &&() { return std::move(To()); } }; int main() { From f; To t (f); return 0; }