removed deprecated handle_alert template

This commit is contained in:
Arvid Norberg 2015-04-26 05:57:07 +00:00
parent a0e6b52a3f
commit 1dc5a7e63d
2 changed files with 1 additions and 64 deletions

View File

@ -1,3 +1,4 @@
* removed deprecated handle_alert template
* enable logging build config by default (but alert mask disabled by default)
* deprecated RSS API
* experimental support for BEP 38, "mutable torrents"

View File

@ -267,70 +267,6 @@ namespace libtorrent {
time_point m_timestamp;
};
// TODO: 3 delete this functionality
#ifndef BOOST_NO_EXCEPTIONS
#ifndef TORRENT_NO_DEPRECATE
struct TORRENT_DEPRECATED TORRENT_EXPORT unhandled_alert : std::exception
{
unhandled_alert() {}
};
#ifndef BOOST_NO_TYPEID
namespace detail {
struct void_;
template<class Handler
, BOOST_PP_ENUM_PARAMS(TORRENT_MAX_ALERT_TYPES, class T)>
TORRENT_DEPRECATED
void handle_alert_dispatch(
const std::auto_ptr<alert>& alert_, const Handler& handler
, const std::type_info& typeid_
, T0*, BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(TORRENT_MAX_ALERT_TYPES, T, *p))
{
if (typeid_ == typeid(T0))
handler(*static_cast<T0*>(alert_.get()));
else
handle_alert_dispatch(alert_, handler, typeid_
, BOOST_PP_ENUM_SHIFTED_PARAMS(
TORRENT_MAX_ALERT_TYPES, p), reinterpret_cast<void_*>(0));
}
template<class Handler>
TORRENT_DEPRECATED
void handle_alert_dispatch(
const std::auto_ptr<alert>&
, const Handler&
, const std::type_info&
, BOOST_PP_ENUM_PARAMS(TORRENT_MAX_ALERT_TYPES, void_* BOOST_PP_INTERCEPT))
{
throw unhandled_alert();
}
} // namespace detail
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
TORRENT_MAX_ALERT_TYPES, class T, detail::void_)>
struct TORRENT_DEPRECATED TORRENT_EXPORT handle_alert
{
template<class Handler>
handle_alert(const std::auto_ptr<alert>& alert_
, const Handler& handler)
{
#define ALERT_POINTER_TYPE(z, n, text) reinterpret_cast<BOOST_PP_CAT(T, n)*>(0)
detail::handle_alert_dispatch(alert_, handler, typeid(*alert_)
, BOOST_PP_ENUM(TORRENT_MAX_ALERT_TYPES, ALERT_POINTER_TYPE, _));
#undef ALERT_POINTER_TYPE
}
};
#endif // BOOST_NO_TYPEID
#endif // TORRENT_NO_DEPRECATE
#endif // BOOST_NO_EXCEPTIONS
// When you get an alert, you can use ``alert_cast<>`` to attempt to cast the pointer to a
// more specific alert type, in order to query it for more information.
template <class T>