I need my exception class, that inherits runtime_class, to accept wstring&. This is MyExceptions.h:
using namespace std;
class myExceptions : public runtime_error
{
public:
myExceptions(const string &msg ) : runtime_error(msg){};
~myExceptions() throw(){};
};
I would like myExceptions to accept wstring& like this : myExceptions(const **wstring** &msg ). But when I run that, I got this error:
C2664: 'std::runtime_error(const std__string &): cannot convert parameter 1 from 'const std::wstring' to 'const std::string &'
I understand that runtime_error accepts string& and not wstring& as defined as following from C++ Reference - runtime_error:
> explicit runtime_error (const string& what_arg);
How can I use wstring& with in runtime_error?