nicer work-around for gcc warnings

[SVN r80656]
This commit is contained in:
Eric Niebler committed 2012-09-23 02:08:32 +00:00
1 parent 0568a114a8
commit 3d650b7f92
3 files changed
+21 -14

No files matched your search

@@ -15,12 +15,6 @@
# error Boost result_of - do not include this file!
#endif
// This header generate spurious warnings on gcc, which we supress by
// treating it as a system header.
#if defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC system_header
#endif
// CWPro8 requires an argument in a function type specialization
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3002)) && BOOST_PP_ITERATION() == 0
# define BOOST_RESULT_OF_ARGS void
@@ -101,7 +95,7 @@ struct BOOST_PP_CAT(result_of_is_callable_, BOOST_PP_ITERATION()) {
typedef typename BOOST_PP_CAT(result_of_select_call_wrapper_type_, BOOST_PP_ITERATION())<F>::type wrapper_t;
static const bool value = (
sizeof(result_of_no_type) == sizeof(detail::result_of_is_private_type(
(boost::declval<wrapper_t>()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), boost::declval<T, >() BOOST_PP_INTERCEPT)), 0)
(boost::declval<wrapper_t>()(BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_ITERATION(), boost::declval<T, >() BOOST_PP_INTERCEPT)), result_of_weird_type())
))
);
typedef mpl::bool_<value> type;
+8 -7
View File
@@ -74,18 +74,19 @@ template<typename F, typename FArgs, bool HasResultType> struct tr1_result_of_im
template<typename T> T result_of_decay(T);
struct result_of_private_type
{
result_of_private_type const &operator,(int) const;
struct result_of_private_type {};
struct result_of_weird_type {
template<typename T>
friend result_of_weird_type operator,(T const &, result_of_weird_type);
friend result_of_private_type operator,(result_of_private_type, result_of_weird_type);
};
typedef char result_of_yes_type; // sizeof(result_of_yes_type) == 1
typedef char (&result_of_no_type)[2]; // sizeof(result_of_no_type) == 2
template<typename T>
result_of_no_type result_of_is_private_type(T const &);
result_of_yes_type result_of_is_private_type(result_of_private_type const &);
result_of_no_type result_of_is_private_type(result_of_weird_type);
result_of_yes_type result_of_is_private_type(result_of_private_type);
template<typename C>
struct result_of_callable_class : C {