From 6c923d45f2aaf960806429d36ca58a41b3a39740 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Wed, 9 Mar 2011 13:40:23 -0500 Subject: kenlm sync --- klm/util/exception.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'klm/util/exception.cc') diff --git a/klm/util/exception.cc b/klm/util/exception.cc index de6dd43c..077405f4 100644 --- a/klm/util/exception.cc +++ b/klm/util/exception.cc @@ -8,6 +8,20 @@ namespace util { Exception::Exception() throw() {} Exception::~Exception() throw() {} +Exception::Exception(const Exception &from) : std::exception() { + stream_.str(from.stream_.str()); +} + +Exception &Exception::operator=(const Exception &from) { + stream_.str(from.stream_.str()); + return *this; +} + +const char *Exception::what() const throw() { + text_ = stream_.str(); + return text_.c_str(); +} + namespace { // The XOPEN version. const char *HandleStrerror(int ret, const char *buf) { @@ -16,7 +30,7 @@ const char *HandleStrerror(int ret, const char *buf) { } // The GNU version. -const char *HandleStrerror(const char *ret, const char *buf) { +const char *HandleStrerror(const char *ret, const char * /*buf*/) { return ret; } } // namespace -- cgit v1.2.3