Ticket #7577: base_from_member.patch

File base_from_member.patch, 767 bytes (added by K-ballo <kaballo86@…>, 10 years ago)

Fix

  • (a) d:\boost_1_51_0\boost\utility\base_from_member.hpp vs. (b) D:\Documents\Visual

    a b  
    7777
    7878};  // boost::base_from_member
    7979
     80
     81// Specialization to deal with references correctly. The general
     82// template constructors take their arguments by value, resulting
     83// in a dangling reference.
     84
     85// Contributed by Agustín K-ballo Bergé
     86
     87template < typename MemberType, int UniqueId >
     88class base_from_member< MemberType&, UniqueId >
     89{
     90protected:
     91    MemberType&  member;
     92
     93    explicit base_from_member( MemberType& x )
     94        : member( x )
     95        {}
     96
     97};  // boost::base_from_member
     98
    8099}  // namespace boost
    81100
    82101