Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualRyan_001

Posted 05 April 2013 - 08:51 AM

The function Exception::GetLineNumber() is:

std::string Exception::GetLineNumber () const {
	const int* line = boost::get_error_info<boost::throw_line>(*this);
	if (line) {
		std::stringstream ss;
		ss << *line;
		return ss.str();
		}
	return "unknown line";
	}

 

BTW I did change throw_detailed to:

template <typename T> BOOST_ATTRIBUTE_NORETURN void ThrowException (T e, const char* func, const char* file, int line) {

 

and Exception constructor looks like:

Exception::Exception (const std::string& msg) {
	*this << ErrMsgInfo(msg);
	}

 

And that's all.


#2Ryan_001

Posted 05 April 2013 - 08:51 AM

The function Exception::GetLineNumber() is:

std::string Exception::GetLineNumber () const {
	const int* line = boost::get_error_info<boost::throw_line>(*this);
	if (line) {
		std::stringstream ss;
		ss << *line;
		return ss.str();
		}
	return "unknown line";
	}

 

BTW I did change throw_detailed to:

template <typename T> BOOST_ATTRIBUTE_NORETURN void ThrowException (T e, const char* func, const char* file, int line) {

 

and Exception constructor and relevant function looks like:

Exception::Exception (const std::string& msg) {
	*this << ErrMsgInfo(msg);
	}

 

And that's all.


#1Ryan_001

Posted 05 April 2013 - 08:50 AM

The function Exception::GetLineNumber() is:

std::string Exception::GetLineNumber () const {
	const int* line = boost::get_error_info<boost::throw_line>(*this);
	if (line) {
		std::stringstream ss;
		ss << *line;
		return ss.str();
		}
	return "unknown line";
	}

 

BTW I did change throw_detailed to:

 

template <typename T> BOOST_ATTRIBUTE_NORETURN void ThrowException (T e, const char* func, const char* file, int line) {

and Exception constructor and relevant function looks like:

Exception::Exception (const std::string& msg) {
	*this << ErrMsgInfo(msg);
	}

 

And that's all.


PARTNERS