mirror of
https://github.com/boostorg/function.git
synced 2025-07-25 10:27:14 +02:00
Support comparisons against 0 on MSVC
[SVN r16618]
This commit is contained in:
@ -329,6 +329,8 @@ namespace boost {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// A type that is only used for comparisons against zero
|
||||||
|
struct useless_clear_type {};
|
||||||
} // end namespace function
|
} // end namespace function
|
||||||
} // end namespace detail
|
} // end namespace detail
|
||||||
|
|
||||||
@ -375,6 +377,32 @@ public:
|
|||||||
void operator==(const function_base&, const function_base&);
|
void operator==(const function_base&, const function_base&);
|
||||||
void operator!=(const function_base&, const function_base&);
|
void operator!=(const function_base&, const function_base&);
|
||||||
|
|
||||||
|
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||||
|
inline bool operator==(const function_base& f,
|
||||||
|
detail::function::useless_clear_type*)
|
||||||
|
{
|
||||||
|
return f.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator!=(const function_base& f,
|
||||||
|
detail::function::useless_clear_type*)
|
||||||
|
{
|
||||||
|
return !f.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator==(detail::function::useless_clear_type*,
|
||||||
|
const function_base& f)
|
||||||
|
{
|
||||||
|
return f.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator!=(detail::function::useless_clear_type*,
|
||||||
|
const function_base& f)
|
||||||
|
{
|
||||||
|
return !f.empty();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace function {
|
namespace function {
|
||||||
inline bool has_empty_target(const function_base* f)
|
inline bool has_empty_target(const function_base* f)
|
||||||
|
Reference in New Issue
Block a user