Changeset 80654


Ignore:
Timestamp:
Sep 23, 2012, 1:11:00 AM (6 years ago)
Author:
Eric Niebler
Message:

gcc-4.4 doesn't have robust enough support for sfinae-for-expressions

Location:
trunk/boost/utility
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/boost/utility/detail/result_of_iterate.hpp

    r80636 r80654  
    5757namespace detail {
    5858
    59 #ifdef BOOST_NO_SFINAE_EXPR
    60 
    61 template<typename F>
    62 struct BOOST_PP_CAT(result_of_is_callable_fun_2_, BOOST_PP_ITERATION());
     59#ifdef BOOST_RESULT_OF_NO_SFINAE_EXPR
     60
     61template<typename F>
     62struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION());
    6363
    6464template<typename R BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(), typename T)>
    65 struct BOOST_PP_CAT(result_of_is_callable_fun_2_, BOOST_PP_ITERATION())<R(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T))> {
     65struct BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<R(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T))> {
    6666    R operator()(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), T)) const;
    6767    typedef result_of_private_type const &(*pfn_t)(...);
     
    7070
    7171template<typename F>
    72 struct BOOST_PP_CAT(result_of_is_callable_fun_, BOOST_PP_ITERATION());
    73 
    74 template<typename F>
    75 struct BOOST_PP_CAT(result_of_is_callable_fun_, BOOST_PP_ITERATION())<F *>
    76   : BOOST_PP_CAT(result_of_is_callable_fun_2_, BOOST_PP_ITERATION())<F>
    77 {};
    78 
    79 template<typename F>
    80 struct BOOST_PP_CAT(result_of_is_callable_fun_, BOOST_PP_ITERATION())<F &>
    81   : BOOST_PP_CAT(result_of_is_callable_fun_2_, BOOST_PP_ITERATION())<F>
     72struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION());
     73
     74template<typename F>
     75struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F *>
     76  : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
     77{};
     78
     79template<typename F>
     80struct BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<F &>
     81  : BOOST_PP_CAT(result_of_callable_fun_2_, BOOST_PP_ITERATION())<F>
    8282{};
    8383
     
    8686  : mpl::eval_if<
    8787        is_class<typename remove_reference<F>::type>,
    88         result_of_wrap_callable<result_of_callable_class, F>,
    89         mpl::identity<BOOST_PP_CAT(result_of_is_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<F>::type> >
     88        result_of_wrap_callable_class<F>,
     89        mpl::identity<BOOST_PP_CAT(result_of_callable_fun_, BOOST_PP_ITERATION())<typename remove_cv<F>::type> >
    9090    >
    9191{};
     
    120120};
    121121
    122 #else // BOOST_NO_SFINAE_EXPR
     122#else // BOOST_RESULT_OF_NO_SFINAE_EXPR
    123123
    124124template<typename F BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_ITERATION(),typename T)>
     
    136136};
    137137
    138 #endif // BOOST_NO_SFINAE_EXPR
     138#endif // BOOST_RESULT_OF_NO_SFINAE_EXPR
    139139
    140140} // namespace detail
  • trunk/boost/utility/result_of.hpp

    r80636 r80654  
    5555#endif
    5656
     57#if defined(BOOST_NO_SFINAE_EXPR) || (BOOST_WORKAROUND(__GNUC__, == 4) && __GNUC_MINOR__ < 5)
     58#  define BOOST_RESULT_OF_NO_SFINAE_EXPR
     59#endif
     60
    5761namespace boost {
    5862
     
    6771template<typename F, typename FArgs, bool HasResultType> struct tr1_result_of_impl;
    6872
    69 #ifdef BOOST_NO_SFINAE_EXPR
     73#ifdef BOOST_RESULT_OF_NO_SFINAE_EXPR
    7074
    7175template<typename T> T result_of_decay(T);
     
    7478{
    7579  result_of_private_type const &operator,(int) const;
    76 };
    77 
    78 template<typename C>
    79 struct result_of_callable_class : C {
    80     result_of_callable_class();
    81     typedef result_of_private_type const &(*pfn_t)(...);
    82     operator pfn_t() const volatile;
    8380};
    8481
     
    9188result_of_yes_type result_of_is_private_type(result_of_private_type const &);
    9289
    93 template<template<typename> class Wrapper, typename C>
    94 struct result_of_wrap_callable {
    95   typedef Wrapper<C> type;
     90template<typename C>
     91struct result_of_callable_class : C {
     92    result_of_callable_class();
     93    typedef result_of_private_type const &(*pfn_t)(...);
     94    operator pfn_t() const volatile;
    9695};
    9796
    98 template<template<typename> class Wrapper, typename C>
    99 struct result_of_wrap_callable<Wrapper, C &> {
    100   typedef typename result_of_wrap_callable<Wrapper, C>::type &type;
     97template<typename C>
     98struct result_of_wrap_callable_class {
     99  typedef result_of_callable_class<C> type;
    101100};
    102101
    103 template<template<typename> class Wrapper, typename C>
    104 struct result_of_wrap_callable<Wrapper, C const> {
    105   typedef typename result_of_wrap_callable<Wrapper, C>::type const type;
     102template<typename C>
     103struct result_of_wrap_callable_class<C const> {
     104  typedef result_of_callable_class<C> const type;
    106105};
    107106
    108 template<template<typename> class Wrapper, typename C>
    109 struct result_of_wrap_callable<Wrapper, C volatile> {
    110   typedef typename result_of_wrap_callable<Wrapper, C>::type volatile type;
     107template<typename C>
     108struct result_of_wrap_callable_class<C volatile> {
     109  typedef result_of_callable_class<C> volatile type;
    111110};
    112111
    113 template<template<typename> class Wrapper, typename C>
    114 struct result_of_wrap_callable<Wrapper, C const volatile> {
    115   typedef typename result_of_wrap_callable<Wrapper, C>::type const volatile type;
     112template<typename C>
     113struct result_of_wrap_callable_class<C const volatile> {
     114  typedef result_of_callable_class<C> const volatile type;
     115};
     116
     117template<typename C>
     118struct result_of_wrap_callable_class<C &> {
     119  typedef typename result_of_wrap_callable_class<C>::type &type;
    116120};
    117121
    118122template<typename F, bool TestCallability = true> struct cpp0x_result_of_impl;
    119123
    120 #else // BOOST_NO_SFINAE_EXPR
     124#else // BOOST_RESULT_OF_NO_SFINAE_EXPR
    121125
    122126template<typename T>
     
    128132template<typename F, typename Enable = void> struct cpp0x_result_of_impl {};
    129133
    130 #endif // BOOST_NO_SFINAE_EXPR
     134#endif // BOOST_RESULT_OF_NO_SFINAE_EXPR
    131135
    132136template<typename F>
Note: See TracChangeset for help on using the changeset viewer.