no legal conversion of return value to return type 'type'
The return value could not be converted to the required type. If you’ve encountered this error on code which compiled with an earlier version of Visual C++, please read Technote: Improved Conformance to ANSI C++ for more information.
You may need to supply a user-defined conversion operator to cast the return value.