Ticket #9064: select_on_conatiner_copy.patch

File select_on_conatiner_copy.patch, 1.6 KB (added by Markus Mathes <Markus.Mathes@…>, 9 years ago)
  • scoped_allocator.hpp

    old new  
    12501250   //! the corresponding allocator in *this.
    12511251   scoped_allocator_adaptor select_on_container_copy_construction() const
    12521252   {
    1253       return scoped_allocator_adaptor
    1254          (internal_type_t()
    1255          ,outer_traits_type::select_on_container_copy_construction(this->outer_allocator())
    1256          ,inner_traits_type::select_on_container_copy_construction(this->inner_allocator())
    1257          );
     1253
     1254       #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) 
     1255       const bool has_zero_inner = sizeof...(InnerAllocs) == 0u;
     1256       #else
     1257       const bool has_zero_inner =
     1258          boost::container::container_detail::is_same
     1259             <Q0, container_detail::nat>::value;
     1260       #endif
     1261
     1262       if (has_zero_inner) {
     1263           return scoped_allocator_adaptor
     1264               (internal_type_t()
     1265               ,outer_traits_type::select_on_container_copy_construction(this->outer_allocator())
     1266               ,this->inner_allocator()
     1267               );
     1268       } else {
     1269           return scoped_allocator_adaptor
     1270                (internal_type_t()
     1271                ,outer_traits_type::select_on_container_copy_construction(this->outer_allocator())
     1272                ,this->inner_allocator()
     1273                //,inner_traits_type::select_on_container_copy_construction(this->inner_allocator())
     1274                );
     1275       }
    12581276   }
    12591277   /// @cond
    12601278   base_type &base()             { return *this; }