Ticket #4526: patchfile3.patch

File patchfile3.patch, 1.3 KB (added by Stefan van Kessel <van_kessel@…>, 12 years ago)

removed unneccsary macros, added value enum member to template to make sure value of _requires_ gets evaluated in absence of decltype(...::value), changed PP condition to use BOOST_TESTED_AT

  • requires.hpp

     
    5050# define BOOST_CONCEPT_REQUIRES(models, result)                                    \
    5151    typename ::boost::parameter::aux::unaryfunptr_arg_type<void(*)result>::type
    5252
     53// Fix for forward declarations of template functions not working on MSVC when the
     54// return type depends on complex types with non-type template arguments
     55#elif BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
     56
     57template <typename T1, typename T2>
     58struct requires_msvc_workaround
     59{
     60    typedef typename T2::type type;
     61        enum{value = T1::value };
     62};
     63
     64#define BOOST_CONCEPT_CLOSE_TEMPLATE(r, data, elem) >
     65#define BOOST_CONCEPT_OPEN_TEMPLATE(r, data, elem)                                                              \
     66        ::boost::requires_msvc_workaround< ::boost::_requires_<void(*) elem > ,
     67
     68#define BOOST_CONCEPT_REQUIRES(models , result)                                                                 \
     69    typename                                                                                                                                    \
     70    BOOST_PP_SEQ_FOR_EACH(BOOST_CONCEPT_OPEN_TEMPLATE, 0, models)                               \
     71        ::boost::parameter::aux::unaryfunptr_arg_type<void(*) result>                           \
     72        BOOST_PP_SEQ_FOR_EACH(BOOST_CONCEPT_CLOSE_TEMPLATE, 0, models)                          \
     73        ::type
     74
    5375#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
    5476
    5577// Same thing as below without the initial typename