Ticket #7227: boost-container2.patch

File boost-container2.patch, 6.4 KB (added by Francois Duranleau <xiao.bai.xiong@…>, 10 years ago)

fixes for throw -> BOOST_THROW_EXCEPTION

  • boost/container/detail/adaptive_node_pool_impl.hpp

    old new  
    557557         //element of the tree
    558558         char *mem_address = static_cast<char*>
    559559            (mp_segment_mngr_base->allocate_aligned(real_block_size, m_real_block_alignment));
    560          if(!mem_address)   throw std::bad_alloc();
     560         if(!mem_address)   BOOST_THROW_EXCEPTION(std::bad_alloc());
    561561         ++m_totally_free_blocks;
    562562         block_info_t *c_info = new(mem_address)block_info_t;
    563563         m_block_multiset.insert(m_block_multiset.end(), *c_info);
     
    584584         //element of the tree
    585585         char *mem_address = static_cast<char*>
    586586            (mp_segment_mngr_base->allocate_aligned(real_block_size, m_real_block_alignment));
    587          if(!mem_address)   throw std::bad_alloc();
     587         if(!mem_address)   BOOST_THROW_EXCEPTION(std::bad_alloc());
    588588         ++m_totally_free_blocks;
    589589
    590590         //First initialize header information on the last subblock
  • boost/container/flat_map.hpp

    old new  
    410410   {
    411411      iterator i = this->find(k);
    412412      if(i == this->end()){
    413          throw std::out_of_range("key not found");
     413                 BOOST_THROW_EXCEPTION(std::out_of_range("key not found"));
    414414      }
    415415      return i->second;
    416416   }
     
    422422   {
    423423      const_iterator i = this->find(k);
    424424      if(i == this->end()){
    425          throw std::out_of_range("key not found");
     425                 BOOST_THROW_EXCEPTION(std::out_of_range("key not found"));
    426426      }
    427427      return i->second;
    428428   }
  • boost/container/list.hpp

    old new  
    931931         this->icont().splice(p.get(), x.icont());
    932932      }
    933933      else{
    934          throw std::runtime_error("list::splice called with unequal allocators");
     934                 BOOST_THROW_EXCEPTION(std::runtime_error("list::splice called with unequal allocators"));
    935935      }
    936936   }
    937937
     
    955955         this->icont().splice(p.get(), x.icont(), i.get());
    956956      }
    957957      else{
    958          throw std::runtime_error("list::splice called with unequal allocators");
     958                 BOOST_THROW_EXCEPTION(std::runtime_error("list::splice called with unequal allocators"));
    959959      }
    960960   }
    961961
     
    978978         this->icont().splice(p.get(), x.icont(), first.get(), last.get());
    979979      }
    980980      else{
    981          throw std::runtime_error("list::splice called with unequal allocators");
     981                 BOOST_THROW_EXCEPTION(std::runtime_error("list::splice called with unequal allocators"));
    982982      }
    983983   }
    984984
     
    10021002         this->icont().splice(p.get(), x.icont(), first.get(), last.get(), n);
    10031003      }
    10041004      else{
    1005          throw std::runtime_error("list::splice called with unequal allocators");
     1005                 BOOST_THROW_EXCEPTION(std::runtime_error("list::splice called with unequal allocators"));
    10061006      }
    10071007   }
    10081008
     
    11071107            ValueCompareToNodeCompare<StrictWeakOrdering>(comp));
    11081108      }
    11091109      else{
    1110          throw std::runtime_error("list::merge called with unequal allocators");
     1110                 BOOST_THROW_EXCEPTION(std::runtime_error("list::merge called with unequal allocators"));
    11111111      }
    11121112   }
    11131113
  • boost/container/map.hpp

    old new  
    363363   {
    364364      iterator i = this->find(k);
    365365      if(i == this->end()){
    366          throw std::out_of_range("key not found");
     366                 BOOST_THROW_EXCEPTION(std::out_of_range("key not found"));
    367367      }
    368368      return i->second;
    369369   }
     
    375375   {
    376376      const_iterator i = this->find(k);
    377377      if(i == this->end()){
    378          throw std::out_of_range("key not found");
     378                 BOOST_THROW_EXCEPTION(std::out_of_range("key not found"));
    379379      }
    380380      return i->second;
    381381   }
  • boost/container/slist.hpp

    old new  
    989989         this->icont().splice_after(prev_pos.get(), x.icont());
    990990      }
    991991      else{
    992          throw std::runtime_error("slist::splice called with unequal allocators");
     992                 BOOST_THROW_EXCEPTION(std::runtime_error("slist::splice called with unequal allocators"));
    993993      }
    994994   }
    995995
     
    10131013         this->icont().splice_after(prev_pos.get(), x.icont(), prev.get());
    10141014      }
    10151015      else{
    1016          throw std::runtime_error("slist::splice called with unequal allocators");
     1016                 BOOST_THROW_EXCEPTION(std::runtime_error("slist::splice called with unequal allocators"));
    10171017      }
    10181018   }
    10191019
     
    10391039            (prev_pos.get(), x.icont(), before_first.get(), before_last.get());
    10401040      }
    10411041      else{
    1042          throw std::runtime_error("slist::splice called with unequal allocators");
     1042                 BOOST_THROW_EXCEPTION(std::runtime_error("slist::splice called with unequal allocators"));
    10431043      }
    10441044   }
    10451045
     
    10671067            (prev_pos.get(), x.icont(), before_first.get(), before_last.get(), n);
    10681068      }
    10691069      else{
    1070          throw std::runtime_error("slist::splice called with unequal allocators");
     1070                 BOOST_THROW_EXCEPTION(std::runtime_error("slist::splice called with unequal allocators"));
    10711071      }
    10721072   }
    10731073
     
    12221222            ValueCompareToNodeCompare<StrictWeakOrdering>(comp));
    12231223      }
    12241224      else{
    1225          throw std::runtime_error("list::merge called with unequal allocators");
     1225                 BOOST_THROW_EXCEPTION(std::runtime_error("list::merge called with unequal allocators"));
    12261226      }
    12271227   }
    12281228
  • boost/container/stable_vector.hpp

    old new  
    819819   {
    820820      STABLE_VECTOR_CHECK_INVARIANT;
    821821      if(n > this->max_size())
    822          throw std::bad_alloc();
     822                 BOOST_THROW_EXCEPTION(std::bad_alloc());
    823823
    824824      size_type size = this->size();   
    825825      size_type old_capacity = this->capacity();
     
    870870   reference at(size_type n)
    871871   {
    872872      if(n>=size())
    873          throw std::out_of_range("invalid subscript at stable_vector::at");
     873                 BOOST_THROW_EXCEPTION(std::out_of_range("invalid subscript at stable_vector::at"));
    874874      return operator[](n);
    875875   }
    876876
     
    885885   const_reference at(size_type n)const
    886886   {
    887887      if(n>=size())
    888          throw std::out_of_range("invalid subscript at stable_vector::at");
     888                 BOOST_THROW_EXCEPTION(std::out_of_range("invalid subscript at stable_vector::at"));
    889889      return operator[](n);
    890890   }
    891891