#include <boost/throw_exception.hpp>
#include <boost/static_assert.hpp>
+// See boost/python/type_id.hpp
+// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp
+# if (defined(__GNUC__) && __GNUC__ >= 3) \
+ || defined(_AIX) \
+ || ( defined(__sgi) && defined(__host_mips)) \
+ || (defined(__hpux) && defined(__HP_aCC)) \
+ || (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC))
+# define BOOST_AUX_ANY_TYPE_ID_NAME
+#include <cstring>
+# endif
+
namespace boost
{
class any
template<typename ValueType>
ValueType * any_cast(any * operand)
{
- return operand && operand->type() == typeid(ValueType)
- ? &static_cast<any::holder<ValueType> *>(operand->content)->held
- : 0;
+ return operand &&
+#ifdef BOOST_AUX_ANY_TYPE_ID_NAME
+ std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0
+#else
+ operand->type() == typeid(ValueType)
+#endif
+ ? &static_cast<any::holder<ValueType> *>(operand->content)->held
+ : 0;
}
template<typename ValueType>
#endif
// last known compiler version:
-#if (__BORLANDC__ > 0x610)
+#if (__BORLANDC__ > 0x613)
//# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
//# else
# endif
#endif
-// Borland C++ Builder 2007 December 2007 Update and below:
-//#if (__BORLANDC__ <= 0x593)
-#if (__BORLANDC__ <= 0x610) // Beman has asked Alisdair for more info
+#if (__BORLANDC__ <= 0x613) // Beman has asked Alisdair for more info
// we shouldn't really need this - but too many things choke
// without it, this needs more investigation:
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
# define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
+# define BOOST_NO_USING_TEMPLATE
+# define BOOST_SP_NO_SP_CONVERTIBLE
// Temporary workaround
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif
// Borland C++ Builder 2008 and below:
-#if (__BORLANDC__ <= 0x601)
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
-# define BOOST_ILLEGAL_CV_REFERENCES
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
-# define BOOST_NO_USING_TEMPLATE
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
# define BOOST_NO_NESTED_FRIENDSHIP
# define BOOST_NO_TYPENAME_WITH_CTOR
+#if (__BORLANDC__ < 0x600)
+# define BOOST_ILLEGAL_CV_REFERENCES
#endif
//
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DELETED_FUNCTIONS
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS // UTF-8 still not supported
#define BOOST_NO_VARIADIC_TEMPLATES
//
// ABI fixing headers:
//
-#if __BORLANDC__ < 0x600 // not implemented for version 6 compiler yet
+#if __BORLANDC__ != 0x600 // not implemented for version 6 compiler yet
#ifndef BOOST_ABI_PREFIX
# define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
#endif
//\r
// versions check:\r
// last known and checked version is 0x610\r
-#if (__CODEGEARC__ > 0x610)\r
+#if (__CODEGEARC__ > 0x613)\r
# if defined(BOOST_ASSERT_CONFIG)\r
# error "Unknown compiler version - please run the configure tests and report the results"\r
# else\r
#endif\r
\r
// CodeGear C++ Builder 2009\r
-#if (__CODEGEARC__ <= 0x610)\r
+#if (__CODEGEARC__ <= 0x613)\r
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL\r
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS\r
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS\r
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS\r
# define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type\r
# define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member\r
+# define BOOST_SP_NO_SP_CONVERTIBLE\r
\r
// Temporary hack, until specific MPL preprocessed headers are generated\r
# define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS\r
#define BOOST_NO_DEFAULTED_FUNCTIONS\r
#define BOOST_NO_DELETED_FUNCTIONS\r
#define BOOST_NO_EXTERN_TEMPLATE\r
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS\r
#define BOOST_NO_INITIALIZER_LISTS\r
#define BOOST_NO_LAMBDAS\r
#define BOOST_NO_NULLPTR\r
#define BOOST_NO_RAW_LITERALS\r
#define BOOST_NO_RVALUE_REFERENCES\r
+#define BOOST_NO_SFINAE_EXPR\r
#define BOOST_NO_STATIC_ASSERT\r
#define BOOST_NO_TEMPLATE_ALIASES\r
#define BOOST_NO_UNICODE_LITERALS\r
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_RAW_LITERALS\r
#define BOOST_NO_RVALUE_REFERENCES\r
#define BOOST_NO_SCOPED_ENUMS\r
+#define BOOST_NO_SFINAE_EXPR\r
#define BOOST_NO_STATIC_ASSERT\r
#define BOOST_NO_TEMPLATE_ALIASES\r
#define BOOST_NO_UNICODE_LITERALS\r
// All problems to gcc-3.x and earlier here:
//
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+# ifdef __OPEN64__
+# define BOOST_NO_IS_ABSTRACT
+# endif
#endif
#ifndef __EXCEPTIONS
// C++0x features not implemented in any GCC version
//
#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
-// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS until it
-// gets fixed. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
-#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_TEMPLATE_ALIASES
+#define BOOST_NO_UNICODE_LITERALS
// C++0x features in 4.3.n and later
//
# define BOOST_HAS_VARIADIC_TMPL
#else
# define BOOST_NO_DECLTYPE
+# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
# define BOOST_NO_RVALUE_REFERENCES
# define BOOST_NO_STATIC_ASSERT
# define BOOST_NO_DELETED_FUNCTIONS
# define BOOST_NO_INITIALIZER_LISTS
# define BOOST_NO_SCOPED_ENUMS
-# define BOOST_NO_UNICODE_LITERALS
+#endif
+
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
+# define BOOST_NO_SFINAE_EXPR
+#endif
+
+// C++0x features in 4.4.1 and later
+//
+#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40401) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS before 4.4.1
+// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
+# define BOOST_NO_SCOPED_ENUMS
+#endif
+
+// C++0x features in 4.5.n and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#endif
// ConceptGCC compiler:
# error "Compiler not configured - please reconfigure"
#endif
//
-// last known and checked version is 4.3 (Pre-release):
-#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 3))
+// last known and checked version is 4.4 (Pre-release):
+#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 4))
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# endif
#endif
-#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1100)
+#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1110)
// GCC or VC emulation:
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#endif
//
// last known and checked version:
-#if (BOOST_INTEL_CXX_VERSION > 1100)
+#if (BOOST_INTEL_CXX_VERSION > 1110)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# elif defined(_MSC_VER)
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_DELETED_FUNCTIONS\r
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS\r
#define BOOST_NO_EXTERN_TEMPLATE\r
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS\r
#define BOOST_NO_INITIALIZER_LISTS\r
#define BOOST_NO_LAMBDAS\r
#define BOOST_NO_NULLPTR\r
#define BOOST_NO_RAW_LITERALS\r
#define BOOST_NO_RVALUE_REFERENCES\r
#define BOOST_NO_SCOPED_ENUMS\r
+#define BOOST_NO_SFINAE_EXPR\r
#define BOOST_NO_STATIC_ASSERT\r
#define BOOST_NO_TEMPLATE_ALIASES\r
#define BOOST_NO_UNICODE_LITERALS\r
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_MSVC _MSC_VER
+#if _MSC_FULL_VER > 100000000
+# define BOOST_MSVC_FULL_VER _MSC_FULL_VER
+#else
+# define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10)
+#endif
+
// turn off the warnings before we #include anything
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES
# define BOOST_HAS_MACRO_USE_FACET
# ifndef _CPPLIB_VER
// Updated Dinkum library defines this, and provides
- // its own min and max definitions.
-# define BOOST_NO_STD_MIN_MAX
+ // its own min and max definitions, as does MTA version.
+# ifndef __MTA__
+# define BOOST_NO_STD_MIN_MAX
+# endif
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
# endif
#endif
# define BOOST_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \
|| defined(_POWER) || defined(__powerpc__) \
- || defined(__ppc__) || defined(__hpux) \
+ || defined(__ppc__) || defined(__hpux) || defined(__hppa) \
|| defined(_MIPSEB) || defined(_POWER) \
|| defined(__s390__)
# define BOOST_BIG_ENDIAN
#include <boost/exception/errinfo_file_open_mode.hpp>\r
#include <boost/exception/errinfo_type_info_name.hpp>\r
#ifndef BOOST_NO_EXCEPTIONS\r
+#include <boost/exception/errinfo_nested_exception.hpp>\r
#include <boost/exception_ptr.hpp>\r
#endif\r
\r
return value_;\r
}\r
\r
+ value_type &\r
+ value()\r
+ {\r
+ return value_;\r
+ }\r
+\r
private:\r
\r
char const * tag_typeid_name() const;\r
std::string value_as_string() const;\r
\r
- value_type const value_;\r
+ value_type value_;\r
};\r
}\r
\r
\r
virtual void _rethrow() const=0;\r
virtual bool _empty() const=0;\r
+\r
+ protected:\r
+\r
+ virtual\r
+ ~exception_ptr_base() throw()\r
+ {\r
+ }\r
};\r
}\r
}\r
inline
char const *
- get_diagnostic_information( exception const & x )
+ get_diagnostic_information( exception const & x, char const * header )
{
if( error_info_container * c=x.data_.get() )
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
- return c->diagnostic_information();
+ return c->diagnostic_information(header);
#ifndef BOOST_NO_EXCEPTIONS
}
catch(...)
inline
std::string
- diagnostic_information_impl( boost::exception const * be, std::exception const * se )
+ diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what )
{
BOOST_ASSERT(be||se);
#ifndef BOOST_NO_RTTI
if( !be )
be = dynamic_cast<boost::exception const *>(se);
#endif
+ char const * wh=0;
+ if( with_what && se )
+ {
+ wh=se->what();
+ if( be && exception_detail::get_diagnostic_information(*be,0)==wh )
+ return wh;
+ }
std::ostringstream tmp;
if( be )
{
tmp << std::string("Dynamic exception type: ") <<
(be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).name() << '\n';
#endif
- if( se )
- tmp << "std::exception::what: " << se->what() << '\n';
+ if( with_what && se )
+ tmp << "std::exception::what: " << wh << '\n';
if( be )
- if( char const * s=exception_detail::get_diagnostic_information(*be) )
+ if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) )
if( *s )
- tmp << s;
+ return s;
return tmp.str();
}
}
typename enable_if<exception_detail::enable_boost_exception_overload<T>,std::string>::type
diagnostic_information( T const & e )
{
- return exception_detail::diagnostic_information_impl(&e,0);
+ return exception_detail::diagnostic_information_impl(&e,0,true);
}
template <class T>
typename enable_if<exception_detail::enable_std_exception_overload<T>,std::string>::type
diagnostic_information( T const & e )
{
- return exception_detail::diagnostic_information_impl(0,&e);
+ return exception_detail::diagnostic_information_impl(0,&e,true);
+ }
+
+ inline
+ char const *
+ diagnostic_information_what( exception const & e ) throw()
+ {
+ char const * w=0;
+#ifndef BOOST_NO_EXCEPTIONS
+ try
+ {
+#endif
+ (void) exception_detail::diagnostic_information_impl(&e,0,false);
+ return exception_detail::get_diagnostic_information(e,0);
+#ifndef BOOST_NO_EXCEPTIONS
+ }
+ catch(
+ ... )
+ {
+ }
+#endif
+ return w;
}
}
boost::exception const * be=current_exception_cast<boost::exception const>();
std::exception const * se=current_exception_cast<std::exception const>();
if( be || se )
- return exception_detail::diagnostic_information_impl(be,se);
+ return exception_detail::diagnostic_information_impl(be,se,true);
else
return "No diagnostic information available.";
}
struct
error_info_container
{
- virtual char const * diagnostic_information() const = 0;
- virtual shared_ptr<error_info_base const> get( type_info_ const & ) const = 0;
- virtual void set( shared_ptr<error_info_base const> const &, type_info_ const & ) = 0;
+ virtual char const * diagnostic_information( char const * ) const = 0;
+ virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
+ virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual void add_ref() const = 0;
virtual void release() const = 0;
template <>
struct get_info<throw_line>;
- char const * get_diagnostic_information( exception const & );
+ char const * get_diagnostic_information( exception const &, char const * );
}
class
return x;
}
- friend char const * exception_detail::get_diagnostic_information( exception const & );
+ friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
template <class E,class Tag,class T>
friend E const & operator<<( E const &, error_info<Tag,T> const & );
get_info\r
{\r
static\r
- typename ErrorInfo::value_type const *\r
+ typename ErrorInfo::value_type *\r
get( exception const & x )\r
{\r
if( exception_detail::error_info_container * c=x.data_.get() )\r
- if( shared_ptr<exception_detail::error_info_base const> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )\r
+ if( shared_ptr<exception_detail::error_info_base> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )\r
{\r
#ifndef BOOST_NO_RTTI\r
- BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo const *>(eib.get()) );\r
+ BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo *>(eib.get()) );\r
#endif\r
- ErrorInfo const * w = static_cast<ErrorInfo const *>(eib.get());\r
+ ErrorInfo * w = static_cast<ErrorInfo *>(eib.get());\r
return &w->value();\r
}\r
return 0;\r
get_info<throw_function>\r
{\r
static\r
- char const * const *\r
+ char const * *\r
get( exception const & x )\r
{\r
return x.throw_function_ ? &x.throw_function_ : 0;\r
get_info<throw_file>\r
{\r
static\r
- char const * const *\r
+ char const * *\r
get( exception const & x )\r
{\r
return x.throw_file_ ? &x.throw_file_ : 0;\r
get_info<throw_line>\r
{\r
static\r
- int const *\r
+ int *\r
get( exception const & x )\r
{\r
return x.throw_line_!=-1 ? &x.throw_line_ : 0;\r
}\r
};\r
+\r
+ template <class T,class R>\r
+ struct\r
+ get_error_info_return_type\r
+ {\r
+ typedef R * type;\r
+ };\r
+\r
+ template <class T,class R>\r
+ struct\r
+ get_error_info_return_type<T const,R>\r
+ {\r
+ typedef R const * type;\r
+ };\r
}\r
\r
#ifdef BOOST_NO_RTTI\r
{\r
return exception_detail::get_info<ErrorInfo>::get(x);\r
}\r
+ template <class ErrorInfo>\r
+ inline\r
+ typename ErrorInfo::value_type *\r
+ get_error_info( boost::exception & x )\r
+ {\r
+ return exception_detail::get_info<ErrorInfo>::get(x);\r
+ }\r
#else\r
template <class ErrorInfo,class E>\r
inline\r
- typename ErrorInfo::value_type const *\r
- get_error_info( E const & some_exception )\r
+ typename exception_detail::get_error_info_return_type<E,typename ErrorInfo::value_type>::type\r
+ get_error_info( E & some_exception )\r
{\r
if( exception const * x = dynamic_cast<exception const *>(&some_exception) )\r
return exception_detail::get_info<ErrorInfo>::get(*x);\r
}
void
- set( shared_ptr<error_info_base const> const & x, type_info_ const & typeid_ )
+ set( shared_ptr<error_info_base> const & x, type_info_ const & typeid_ )
{
BOOST_ASSERT(x);
info_[typeid_] = x;
diagnostic_info_str_.clear();
}
- shared_ptr<error_info_base const>
+ shared_ptr<error_info_base>
get( type_info_ const & ti ) const
{
error_info_map::const_iterator i=info_.find(ti);
if( info_.end()!=i )
{
- shared_ptr<error_info_base const> const & p = i->second;
+ shared_ptr<error_info_base> const & p = i->second;
#ifndef BOOST_NO_RTTI
BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p)==ti );
#endif
return p;
}
- return shared_ptr<error_info_base const>();
+ return shared_ptr<error_info_base>();
}
char const *
- diagnostic_information() const
+ diagnostic_information( char const * header ) const
{
- if( diagnostic_info_str_.empty() )
+ if( header )
{
+ BOOST_ASSERT(*header!=0);
std::ostringstream tmp;
+ tmp << header;
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
{
shared_ptr<error_info_base const> const & x = i->second;
friend class boost::exception;
- typedef std::map< type_info_, shared_ptr<error_info_base const> > error_info_map;
+ typedef std::map< type_info_, shared_ptr<error_info_base> > error_info_map;
error_info_map info_;
mutable std::string diagnostic_info_str_;
mutable int count_;
#include <sstream>
#endif
-#if defined(BOOST_NO_STRINGSTREAM) || \
- defined(BOOST_NO_STD_WSTRING) || \
- defined(BOOST_NO_STD_LOCALE)
+#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_WSTRING)
#define BOOST_LCAST_NO_WCHAR_T
#endif
+#ifdef BOOST_NO_TYPEID
+#define BOOST_LCAST_THROW_BAD_CAST(S, T) throw_exception(bad_lexical_cast())
+#else
+#define BOOST_LCAST_THROW_BAD_CAST(Source, Target) \
+ throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
+#endif
+
namespace boost
{
// exception used to indicate runtime lexical_cast failure
lexical_stream(char_type* = 0, char_type* = 0)
{
stream.unsetf(std::ios::skipws);
- lcast_set_precision(stream, (Source*)0, (Target*)0);
+ lcast_set_precision(stream, static_cast<Source*>(0), static_cast<Target*>(0) );
}
~lexical_stream()
{
{
this->setp(start, finish);
std::basic_ostream<CharT> stream(static_cast<Base*>(this));
- lcast_set_precision(stream, (OutputStreamable*)0);
+ lcast_set_precision(stream, static_cast<OutputStreamable*>(0));
bool const result = !(stream << input).fail();
finish = this->pptr();
return result;
this->setg(start, start, finish);
std::basic_istream<CharT> stream(static_cast<Base*>(this));
stream.unsetf(std::ios::skipws);
- lcast_set_precision(stream, (InputStreamable*)0);
+ lcast_set_precision(stream, static_cast<InputStreamable*>(0));
#if (defined _MSC_VER)
# pragma warning( pop )
#endif
typedef const T * type;
};
+#if (defined _MSC_VER)
+# pragma warning( push )
+# pragma warning( disable : 4701 ) // possible use of ... before initialization
+# pragma warning( disable : 4702 ) // unreachable code
+#endif
+
template< typename Target
, typename Source
, bool Unlimited // string representation of Source is unlimited
, detail::lexical_stream_limited_src<CharT,base,traits>
>::type interpreter(buf, buf + src_len);
- // The original form, reproduced below, is more elegant
- // but yields a spurious C4701 warning ("possible use of
- // "result" before initialization") with VC7.1 (/W4).
-//
-// Target result;
-//
-// if(!(interpreter << arg && interpreter >> result))
-// throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
-// return result;
-
- if(interpreter << arg) {
- Target result;
- if (interpreter >> result)
- return result;
- }
-#ifndef BOOST_NO_TYPEID
- throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
-#else
- throw_exception(bad_lexical_cast());
-#endif
- return Target(); // normally never reached (throw_exception)
+ Target result;
+ if(!(interpreter << arg && interpreter >> result))
+ BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+ return result;
}
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#endif
}
template<typename Target, typename Source>
v = static_cast<int>(hash_value_from_capture_name(base, m_position));
re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace)));
br->index = v;
- if((*m_position != charT('>')) && (*m_position != charT('\'')) || (++m_position == m_end))
+ if(((*m_position != charT('>')) && (*m_position != charT('\''))) || (++m_position == m_end))
{
fail(regex_constants::error_badrepeat, m_position - m_base);
return false;
|| slot_ == other.slot_));
}
-#if BOOST_WORKAROUND(_MSC_VER, <= 1500)
+#if BOOST_WORKAROUND(_MSC_VER, <= 1600)
void decrement();
void advance(difference_type);
#endif
template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
{
- //All boost exceptions are required to derive std::exception,
+ //All boost exceptions are required to derive from std::exception,
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
throw_exception_assert_compatibility(e);
BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(has_new_operator_impl<T>::template check_sig<T>(0)));\r
BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(has_new_operator_impl<T>::template check_sig2<T>(0)));\r
#else\r
- #if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)\r
+ #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)\r
#pragma warning(push)\r
#pragma warning(disable:6334)\r
#endif\r
BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig<T>(0)));\r
BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(check_sig2<T>(0)));\r
\r
- #if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)\r
+ #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)\r
#pragma warning(pop)\r
#endif\r
#endif\r
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
-#if defined(BOOST_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215)
+#if defined(BOOST_MSVC) && defined(BOOST_MSVC_FULL_VER) && (BOOST_MSVC_FULL_VER >=140050215)
# include <boost/type_traits/is_same.hpp>
# define BOOST_IS_UNION(T) __is_union(T)
#ifdef __GNUC__
BOOST_STATIC_CONSTANT(std::size_t, s1 = sizeof(is_abstract_imp2<T>::template check_sig<T>(0)));
#else
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
BOOST_STATIC_CONSTANT(std::size_t, s1 = sizeof(check_sig<T>(0)));
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(pop)
#endif
#endif
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/detail/ice_and.hpp>
-#include <boost/type_traits/remove_cv.hpp>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#endif
+#include <boost/type_traits/remove_cv.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
template<typename B, typename D>
struct is_base_and_derived_impl2
{
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
BOOST_STATIC_CONSTANT(bool, value =
sizeof(bd_helper<B,D>::check_sig(Host(), 0)) == sizeof(type_traits::yes_type));
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(pop)
#endif
};
typedef is_base_and_derived_select<
::boost::is_class<B>::value,
::boost::is_class<D>::value,
- ::boost::is_same<B,D>::value> selector;
+ ::boost::is_same<ncvB,ncvD>::value> selector;
typedef typename selector::template rebind<ncvB,ncvD> binder;
typedef typename binder::type bound_type;
template <typename B, typename D>
struct is_base_and_derived_impl
{
- BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_BASE_OF(B,D));
+ typedef typename remove_cv<B>::type ncvB;
+ typedef typename remove_cv<D>::type ncvD;
+
+ BOOST_STATIC_CONSTANT(bool, value = (BOOST_IS_BASE_OF(B,D) && ! ::boost::is_same<ncvB,ncvD>::value));
};
#endif
} // namespace detail
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
+#include <boost/type_traits/detail/ice_and.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
+ namespace detail{
+ template <class B, class D>
+ struct is_base_of_imp
+ {
+ typedef typename remove_cv<B>::type ncvB;
+ typedef typename remove_cv<D>::type ncvD;
+ BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or<
+ (::boost::detail::is_base_and_derived_impl<ncvB,ncvD>::value),
+ (::boost::type_traits::ice_and< ::boost::is_same<ncvB,ncvD>::value, ::boost::is_class<ncvB>::value>::value)>::value));
+ };
+ }
+
BOOST_TT_AUX_BOOL_TRAIT_DEF2(
is_base_of
, Base
, Derived
- , (::boost::type_traits::ice_or<
- (::boost::detail::is_base_and_derived_impl<Base,Derived>::value),
- (::boost::is_same<Base,Derived>::value)>::value)
- )
+ , (::boost::detail::is_base_of_imp<Base, Derived>::value))
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false)
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4244)
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(disable:6334)
#endif
#endif
template <typename T>
struct is_function_impl
{
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t))
== sizeof(::boost::type_traits::yes_type)
);
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(pop)
#endif
};
{
template <typename T> struct result_
{
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
bool, value = (
1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
));
-#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
+#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
#pragma warning(pop)
#endif
};
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
-#if !BOOST_WORKAROUND(__MWERKS__,<=0x3003)
+#if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) && !BOOST_WORKAROUND(__IBMCPP__, <=600)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true)
struct is_signed_helper
{
typedef typename remove_cv<T>::type no_cv_t;
- BOOST_STATIC_CONSTANT(bool, value = (static_cast<no_cv_t>(-1) < 0));
+ BOOST_STATIC_CONSTANT(bool, value = (!(static_cast<no_cv_t>(-1) > 0)));
};
template <bool integral_type>
X();\r
X(const X&);\r
X& operator=(const X&);\r
- ~X();\r
+ ~X()throw();\r
};\r
struct Y : public virtual Derived \r
{\r
Y();\r
Y(const Y&);\r
Y& operator=(const Y&);\r
- ~Y();\r
+ ~Y()throw();\r
};\r
#else\r
struct X : Derived, virtual Base \r
X();\r
X(const X&);\r
X& operator=(const X&);\r
- ~X();\r
+ ~X()throw();\r
};\r
struct Y : Derived \r
{\r
Y();\r
Y(const Y&);\r
Y& operator=(const Y&);\r
- ~Y();\r
+ ~Y()throw();\r
};\r
#endif\r
BOOST_STATIC_CONSTANT(bool, value = (sizeof(X)==sizeof(Y)));\r
// 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker\r
// 23 May 2008 (Fixed operator= const issue, added initialized_value) Niels Dekker, Fernando Cacciola\r
// 21 Ago 2008 (Added swap) Niels Dekker, Fernando Cacciola\r
+// 20 Feb 2009 (Fixed logical const-ness issues) Niels Dekker, Fernando Cacciola\r
//\r
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP\r
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP\r
wrapper_address()->wrapper::~wrapper();\r
}\r
\r
- T& data() const\r
+ T const & data() const\r
+ {\r
+ return wrapper_address()->data;\r
+ }\r
+\r
+ T& data()\r
{\r
return wrapper_address()->data;\r
}\r
::boost::swap( this->data(), arg.data() );\r
}\r
\r
- operator T&() const { return this->data(); }\r
+ operator T const &() const { return this->data(); }\r
+\r
+ operator T&() { return this->data(); }\r
\r
} ;\r
\r
\r
\r
+\r
+\r
template<class T>\r
T const& get ( value_initialized<T> const& x )\r
{\r
// BOOST_VERSION / 100 % 1000 is the minor version
// BOOST_VERSION / 100000 is the major version
-#define BOOST_VERSION 104000
+#define BOOST_VERSION 104100
//
// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
// number, y is the minor version number, and z is the patch level if not 0.
// This is used by <config/auto_link.hpp> to select which library version to link to.
-#define BOOST_LIB_VERSION "1_40"
+#define BOOST_LIB_VERSION "1_41"
#endif
typedef slot_container_type::const_iterator const_group_iterator;
-#if BOOST_WORKAROUND(_MSC_VER, <= 1500)
+#if BOOST_WORKAROUND(_MSC_VER, <= 1600)
void named_slot_map_iterator::decrement() { assert(false); }
void named_slot_map_iterator::advance(difference_type) { assert(false); }
#endif