File indexing completed on 2025-12-16 09:45:25
0001
0002
0003
0004
0005
0006 #ifndef BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
0007 #define BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
0008
0009 #include <boost/config.hpp>
0010 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
0011 #include <boost/type_traits/is_nothrow_move_constructible.hpp>
0012 #endif
0013 #include <utility>
0014 #include <string>
0015
0016 #ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
0017 #if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
0018 #pragma GCC system_header
0019 #endif
0020 #ifdef __clang__
0021 #pragma clang system_header
0022 #endif
0023 #ifdef _MSC_VER
0024 #pragma warning(push,1)
0025 #endif
0026 #endif
0027
0028 namespace
0029 boost
0030 {
0031 namespace
0032 exception_detail
0033 {
0034 class
0035 error_info_base
0036 {
0037 public:
0038
0039 virtual std::string name_value_string() const = 0;
0040 virtual error_info_base * clone() const = 0;
0041
0042 virtual
0043 ~error_info_base() BOOST_NOEXCEPT_OR_NOTHROW
0044 {
0045 }
0046 };
0047 }
0048
0049 template <class Tag,class T>
0050 class
0051 error_info:
0052 public exception_detail::error_info_base
0053 {
0054 exception_detail::error_info_base *
0055 clone() const
0056 {
0057 return new error_info<Tag,T>(*this);
0058 }
0059 public:
0060 typedef T value_type;
0061 error_info( value_type const & v ):
0062 v_(v)
0063 {
0064 }
0065 #if (__GNUC__*100+__GNUC_MINOR__!=406)
0066 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
0067 error_info( error_info const & x ):
0068 v_(x.v_)
0069 {
0070 }
0071 error_info( T && v ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
0072 v_(std::move(v))
0073 {
0074 }
0075 error_info( error_info && x ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
0076 v_(std::move(x.v_))
0077 {
0078 }
0079 #endif
0080 #endif
0081 ~error_info() BOOST_NOEXCEPT_OR_NOTHROW
0082 {
0083 }
0084 value_type const &
0085 value() const
0086 {
0087 return v_;
0088 }
0089 value_type &
0090 value()
0091 {
0092 return v_;
0093 }
0094 private:
0095 error_info & operator=( error_info const & );
0096 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
0097 error_info & operator=( error_info && x );
0098 #endif
0099 std::string name_value_string() const;
0100 value_type v_;
0101 };
0102 }
0103
0104 #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
0105 #pragma warning(pop)
0106 #endif
0107 #endif