mirror of
https://github.com/boostorg/exception.git
synced 2025-07-21 16:32:05 +02:00
Improving CodeGear C++Builder 2009 compatibility
[SVN r48918]
This commit is contained in:
@ -313,7 +313,8 @@ boost
|
|||||||
exception_detail::enable_error_info_return_type<T>::type
|
exception_detail::enable_error_info_return_type<T>::type
|
||||||
enable_error_info( T const & x )
|
enable_error_info( T const & x )
|
||||||
{
|
{
|
||||||
return typename exception_detail::enable_error_info_return_type<T>::type(x);
|
typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
|
||||||
|
return rt(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include <boost/exception/detail/error_info_impl.hpp>
|
#include <boost/exception/detail/error_info_impl.hpp>
|
||||||
#include <boost/exception/detail/type_info.hpp>
|
#include <boost/exception/detail/type_info.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
boost
|
boost
|
||||||
@ -21,30 +20,16 @@ boost
|
|||||||
struct
|
struct
|
||||||
strwrap
|
strwrap
|
||||||
{
|
{
|
||||||
char const * str;
|
std::string str;
|
||||||
|
char const * ptr;
|
||||||
strwrap( char const * s ):
|
strwrap( char const * s ):
|
||||||
str(init(s))
|
str(s),
|
||||||
|
ptr(&str[0])
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~strwrap()
|
|
||||||
{
|
|
||||||
delete[] str;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
strwrap( strwrap const & );
|
strwrap( strwrap const & );
|
||||||
strwrap & operator=( strwrap const & );
|
strwrap & operator=( strwrap const & );
|
||||||
|
|
||||||
static
|
|
||||||
char const *
|
|
||||||
init( char const * s )
|
|
||||||
{
|
|
||||||
size_t n=1+strlen(s);
|
|
||||||
char * str = new char[n];
|
|
||||||
(void) memcpy(str,s,n);
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
@ -55,10 +40,10 @@ boost
|
|||||||
shared_ptr<char const * const>
|
shared_ptr<char const * const>
|
||||||
get( exception const & x )
|
get( exception const & x )
|
||||||
{
|
{
|
||||||
if( x.throw_function_ )
|
if( x.throw_function_ && *x.throw_function_ )
|
||||||
{
|
{
|
||||||
shared_ptr<strwrap> s(new strwrap(x.throw_function_));
|
shared_ptr<strwrap> s(new strwrap(x.throw_function_));
|
||||||
return shared_ptr<char const *>(s,&s->str);
|
return shared_ptr<char const *>(s,&s->ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return shared_ptr<char const * const>();
|
return shared_ptr<char const * const>();
|
||||||
@ -73,10 +58,10 @@ boost
|
|||||||
shared_ptr<char const * const>
|
shared_ptr<char const * const>
|
||||||
get( exception const & x )
|
get( exception const & x )
|
||||||
{
|
{
|
||||||
if( x.throw_file_ )
|
if( x.throw_file_ && *x.throw_file_ )
|
||||||
{
|
{
|
||||||
shared_ptr<strwrap> s(new strwrap(x.throw_file_));
|
shared_ptr<strwrap> s(new strwrap(x.throw_file_));
|
||||||
return shared_ptr<char const *>(s,&s->str);
|
return shared_ptr<char const *>(s,&s->ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return shared_ptr<char const * const>();
|
return shared_ptr<char const * const>();
|
||||||
|
@ -99,7 +99,7 @@ boost
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
clone_base const *
|
exception_detail::clone_base const *
|
||||||
clone() const
|
clone() const
|
||||||
{
|
{
|
||||||
return new unknown_exception(*this);
|
return new unknown_exception(*this);
|
||||||
|
Reference in New Issue
Block a user