2010-02-01 00:25:15 +00:00
|
|
|
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
|
2008-08-28 23:49:55 +00:00
|
|
|
|
|
|
|
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
2019-12-21 14:15:17 -08:00
|
|
|
#ifndef BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
|
|
|
|
#define BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
|
2017-02-20 18:23:36 -08:00
|
|
|
|
|
|
|
#include <boost/config.hpp>
|
2017-03-30 16:56:13 -07:00
|
|
|
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
|
|
|
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
|
|
|
|
#endif
|
2017-02-20 18:23:36 -08:00
|
|
|
#include <utility>
|
|
|
|
#include <string>
|
|
|
|
|
2020-04-06 18:23:52 -07:00
|
|
|
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
|
|
|
|
#if __GNUC__*100+__GNUC_MINOR__>301
|
2009-12-01 02:16:50 +00:00
|
|
|
#pragma GCC system_header
|
|
|
|
#endif
|
2020-04-06 18:23:52 -07:00
|
|
|
#ifdef __clang__
|
|
|
|
#pragma clang system_header
|
|
|
|
#endif
|
|
|
|
#ifdef _MSC_VER
|
2009-12-04 06:33:47 +00:00
|
|
|
#pragma warning(push,1)
|
|
|
|
#endif
|
2020-04-06 18:23:52 -07:00
|
|
|
#endif
|
2009-12-01 02:16:50 +00:00
|
|
|
|
2008-08-28 23:49:55 +00:00
|
|
|
namespace
|
|
|
|
boost
|
|
|
|
{
|
|
|
|
namespace
|
|
|
|
exception_detail
|
|
|
|
{
|
|
|
|
class
|
|
|
|
error_info_base
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2012-12-23 03:31:48 +00:00
|
|
|
virtual std::string name_value_string() const = 0;
|
2017-03-15 11:39:42 -07:00
|
|
|
virtual error_info_base * clone() const = 0;
|
2008-08-28 23:49:55 +00:00
|
|
|
|
2012-04-28 06:05:06 +00:00
|
|
|
virtual
|
2019-01-28 09:48:53 +02:00
|
|
|
~error_info_base() BOOST_NOEXCEPT_OR_NOTHROW
|
2008-08-28 23:49:55 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2008-09-02 23:13:06 +00:00
|
|
|
|
|
|
|
template <class Tag,class T>
|
|
|
|
class
|
|
|
|
error_info:
|
|
|
|
public exception_detail::error_info_base
|
|
|
|
{
|
2018-04-07 14:58:25 +01:00
|
|
|
exception_detail::error_info_base *
|
2017-03-15 11:39:42 -07:00
|
|
|
clone() const
|
|
|
|
{
|
|
|
|
return new error_info<Tag,T>(*this);
|
|
|
|
}
|
2016-10-26 11:51:40 -07:00
|
|
|
public:
|
2008-09-02 23:13:06 +00:00
|
|
|
typedef T value_type;
|
2017-01-03 14:35:11 -08:00
|
|
|
error_info( value_type const & v ):
|
|
|
|
v_(v)
|
|
|
|
{
|
|
|
|
}
|
2017-01-03 15:25:52 -08:00
|
|
|
#if (__GNUC__*100+__GNUC_MINOR__!=406) //workaround for g++ bug
|
2015-03-24 15:44:28 -07:00
|
|
|
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
2017-01-03 14:35:11 -08:00
|
|
|
error_info( error_info const & x ):
|
|
|
|
v_(x.v_)
|
|
|
|
{
|
|
|
|
}
|
2017-03-30 17:09:43 -07:00
|
|
|
error_info( T && v ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
|
2017-01-03 14:35:11 -08:00
|
|
|
v_(std::move(v))
|
|
|
|
{
|
|
|
|
}
|
2017-03-30 17:09:43 -07:00
|
|
|
error_info( error_info && x ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
|
2017-01-03 14:35:11 -08:00
|
|
|
v_(std::move(x.v_))
|
|
|
|
{
|
|
|
|
}
|
2015-03-24 15:44:28 -07:00
|
|
|
#endif
|
|
|
|
#endif
|
2019-01-28 09:48:53 +02:00
|
|
|
~error_info() BOOST_NOEXCEPT_OR_NOTHROW
|
2017-01-03 14:35:11 -08:00
|
|
|
{
|
|
|
|
}
|
2008-09-02 23:13:06 +00:00
|
|
|
value_type const &
|
|
|
|
value() const
|
|
|
|
{
|
2017-01-03 12:17:27 -08:00
|
|
|
return v_;
|
2008-09-02 23:13:06 +00:00
|
|
|
}
|
2009-08-21 22:28:44 +00:00
|
|
|
value_type &
|
|
|
|
value()
|
|
|
|
{
|
2017-01-03 12:17:27 -08:00
|
|
|
return v_;
|
2009-08-21 22:28:44 +00:00
|
|
|
}
|
2016-10-26 11:51:40 -07:00
|
|
|
private:
|
2015-03-24 15:44:28 -07:00
|
|
|
error_info & operator=( error_info const & );
|
|
|
|
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
|
|
|
error_info & operator=( error_info && x );
|
|
|
|
#endif
|
2012-12-23 03:31:48 +00:00
|
|
|
std::string name_value_string() const;
|
2017-01-03 12:17:27 -08:00
|
|
|
value_type v_;
|
2008-09-02 23:13:06 +00:00
|
|
|
};
|
2008-08-28 23:49:55 +00:00
|
|
|
}
|
|
|
|
|
2009-12-04 06:33:47 +00:00
|
|
|
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif
|
2008-08-28 23:49:55 +00:00
|
|
|
#endif
|