Use built-in deprecation facilities, when available

[SVN r14677]
This commit is contained in:
Douglas Gregor
2002-08-05 03:08:08 +00:00
parent 837591456f
commit 694ebbb301
3 changed files with 22 additions and 9 deletions

View File

@ -538,7 +538,7 @@ namespace boost {
typename InMixin = empty_function_mixin, typename InMixin = empty_function_mixin,
typename InAllocator = std::allocator<function_base> typename InAllocator = std::allocator<function_base>
> >
class get_function_impl struct get_function_impl
{ {
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef maybe_decode_function_args<(is_function<InR>::value), typedef maybe_decode_function_args<(is_function<InR>::value),
@ -576,7 +576,7 @@ namespace boost {
typedef InMixin Mixin; typedef InMixin Mixin;
typedef InAllocator Allocator; typedef InAllocator Allocator;
#endif // def BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #endif // def BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
public:
typedef typename real_get_function_impl< typedef typename real_get_function_impl<
(count_used_args<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value) (count_used_args<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value)
>::template params<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, >::template params<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
@ -739,21 +739,24 @@ namespace boost {
} }
template<typename Functor> template<typename Functor>
void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) BOOST_FUNCTION_DEPRECATED_PRE
void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
{ {
int deprecated; BOOST_FUNCTION_DEPRECATED_INNER
self_type(f).swap(*this); self_type(f).swap(*this);
} }
void set(const base_type& f) BOOST_FUNCTION_DEPRECATED_PRE
void set(const base_type& f)
{ {
int deprecated; BOOST_FUNCTION_DEPRECATED_INNER
self_type(f).swap(*this); self_type(f).swap(*this);
} }
BOOST_FUNCTION_DEPRECATED_PRE
void set(const self_type& f) void set(const self_type& f)
{ {
int deprecated; BOOST_FUNCTION_DEPRECATED_INNER
self_type(f).swap(*this); self_type(f).swap(*this);
} }
}; };

View File

@ -31,6 +31,14 @@
# define BOOST_FUNCTION_TARGET_FIX(x) # define BOOST_FUNCTION_TARGET_FIX(x)
#endif // not MSVC #endif // not MSVC
#if defined (BOOST_MSVC) && (BOOST_MSVC >= 1300)
# define BOOST_FUNCTION_DEPRECATED_PRE __declspec(deprecated)
# define BOOST_FUNCTION_DEPRECATED_INSIDE
#else
# define BOOST_FUNCTION_DEPRECATED_PRE
# define BOOST_FUNCTION_DEPRECATED_INSIDE int deprecated;
#endif
namespace boost { namespace boost {
namespace detail { namespace detail {
namespace function { namespace function {

View File

@ -322,9 +322,10 @@ namespace boost {
} }
template<typename Functor> template<typename Functor>
BOOST_FUNCTION_DEPRECATED_PRE
void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
{ {
int deprecated; BOOST_FUNCTION_DEPRECATED_INNER
self_type(f, static_cast<const Mixin&>(*this)).swap(*this); self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
} }
@ -339,9 +340,10 @@ namespace boost {
} }
// Assignment from another BOOST_FUNCTION_FUNCTION // Assignment from another BOOST_FUNCTION_FUNCTION
BOOST_FUNCTION_DEPRECATED_PRE
void set(const BOOST_FUNCTION_FUNCTION& f) void set(const BOOST_FUNCTION_FUNCTION& f)
{ {
int deprecated; BOOST_FUNCTION_DEPRECATED_INNER
if (&f == this) if (&f == this)
return; return;