why not just switch to a language like C# then? Seems like a lot of work just to do something that is already common place in another almost identical language.
In what universe is C# "almost identical" to C++?
why not just switch to a language like C# then? Seems like a lot of work just to do something that is already common place in another almost identical language.
In what universe is C# "almost identical" to C++?
#ifndef cmw_ErrorWords_hh
#define cmw_ErrorWords_hh
#include <exception>
#include <flex_string.h>
#include <sstream>
class failure : public ::std::exception {
flex_string<char> whatStr;
public:
explicit failure (flex_string<char> const what_) : whatStr(what_)
{}
~failure () throw()
{}
char const* what () const throw()
{ return whatStr.c_str(); }
template <typename T>
failure& operator<< (T val)
{
::std::stringstream ss;
ss << val;
whatStr.append(ss.str().c_str());
return *this;
}
};
class eof : public ::std::exception {
flex_string<char> whatStr;
public:
explicit eof (flex_string<char> const what_) : whatStr(what_)
{}
~eof () throw()
{}
char const* what () const throw()
{ return whatStr.c_str(); }
};
#endif
class eof : public failure {
public:
explicit eof (flex_string<char> const what_) : failure(what_)
{}
~eof () throw()
{}
};
why not just switch to a language like C# then? Seems like a lot of work just to do something that is already common place in another almost identical language.