Ticket #9648: boost_container_string_assign_optimization.patch

File boost_container_string_assign_optimization.patch, 956 bytes (added by Adam Romanek <romanek.adam@…>, 9 years ago)

fix proposal

  • boost/container/string.hpp

    diff -Naur .build/boost_1_54_0/boost/container/string.hpp .build/boost_1_54_0_patched/boost/container/string.hpp
    old new  
    12441244   basic_string& assign(const CharT* s)
    12451245   { return this->assign(s, s + Traits::length(s)); }
    12461246
     1247   //! <b>Effects</b>: Equivalent to assign(basic_string(first, last)).
     1248   //!
     1249   //! <b>Returns</b>: *this
     1250   basic_string& assign(const CharT* first, const CharT* last)
     1251   {
     1252      size_type n = std::distance(first, last);
     1253      this->reserve(n);
     1254      CharT* ptr = container_detail::to_raw_pointer(this->priv_addr());
     1255      Traits::copy(ptr, first, n);
     1256      this->priv_construct_null(ptr + n);
     1257      return *this;
     1258   }
     1259
    12471260   //! <b>Effects</b>: Equivalent to assign(basic_string(n, c)).
    12481261   //!
    12491262   //! <b>Returns</b>: *this