Ticket #7033: memory_util.patch

File memory_util.patch, 1.7 KB (added by lukester_null@…, 10 years ago)
  • C:\Users\luke\Desktop\memory_util.hpp

    old new  
    179179//struct type_rebind_mode
    180180///////////////////////////
    181181template <typename Ptr, typename T>
    182182struct type_has_rebind
    183183{
    184184   template <typename X>
     185#if (!defined __SUNPRO_CC)
    185186   static char test(int, typename X::template rebind<T>*);
     187#else
     188   static char test(int, typename X::rebind<T>*);
     189#endif
    186190
    187191   template <typename X>
    188192   static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*);
    189193
    190194   static const bool value = (1 == sizeof(test<Ptr>(0, 0)));
    191195};
    192196
    193197template <typename Ptr, typename T>
    194198struct type_has_rebind_other
    195199{
    196200   template <typename X>
     201#if (!defined __SUNPRO_CC)
    197202   static char test(int, typename X::template rebind<T>::other*);
     203#else
     204   static char test(int, typename X::rebind<T>::other*);
     205#endif
    198206
    199207   template <typename X>
    200208   static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*);
    201209
    202210   static const bool value = (1 == sizeof(test<Ptr>(0, 0)));
    203211};
    204212
    205213template <typename Ptr, typename T>
    206214struct type_rebind_mode
    207215{
    208    template <typename X>
    209    static char test(int, typename X::template rebind<T>::other*);
    210 
    211    template <typename X>
    212    static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*);
    213 
    214216   static const unsigned int rebind =       (unsigned int)type_has_rebind<Ptr, T>::value;
    215217   static const unsigned int rebind_other = (unsigned int)type_has_rebind_other<Ptr, T>::value;
    216218   static const unsigned int mode =         rebind + rebind*rebind_other;
    217219};
    218220
    219221////////////////////////