Ticket #3124: fix3124.patch
File fix3124.patch, 4.0 KB (added by , 13 years ago) |
---|
-
boost/xpressive/detail/utility/sequence_stack.hpp
173 173 this->begin_ = this->curr_ = this->end_ = 0; 174 174 } 175 175 176 template<bool Fill> 177 T *push_sequence(std::size_t count, mpl::bool_<Fill>) 176 T *push_sequence(std::size_t count) 178 177 { 179 178 // This is the ptr to return 180 179 T *ptr = this->curr_; … … 192 191 return this->grow_(count); 193 192 } 194 193 195 if(Fill)196 {197 std::fill_n(ptr, count, T());198 }199 200 194 return ptr; 201 195 } 202 196 203 T *push_sequence(std::size_t count) 197 template<typename U> 198 T *push_sequence(std::size_t count, U const &u) 204 199 { 205 return this->push_sequence(count, mpl::true_()); 200 T *ptr = this->push_sequence(count); 201 std::fill_n(ptr, count, u); 202 return ptr; 206 203 } 207 204 208 205 void unwind_to(T *ptr) … … 229 226 } 230 227 }; 231 228 232 typedef mpl::false_ no_fill_t;233 no_fill_t const no_fill = {};234 235 229 }}} // namespace boost::xpressive::detail 236 230 237 231 #if defined(_MSC_VER) && (_MSC_VER >= 1020) -
boost/xpressive/detail/core/state.hpp
289 289 this->context_.results_ptr_ = &what; 290 290 this->context_.traits_ = impl.traits_.get(); 291 291 this->mark_count_ = impl.mark_count_ + 1; 292 this->sub_matches_ = this->extras_->sub_match_stack_.push_sequence(total_mark_count );292 this->sub_matches_ = this->extras_->sub_match_stack_.push_sequence(total_mark_count, detail::sub_match_impl_default()); 293 293 this->sub_matches_ += impl.hidden_mark_count_; 294 294 295 295 // initialize the match_results struct … … 329 329 { 330 330 memento<BidiIter> mem = 331 331 { 332 state.extras_->sub_match_stack_.push_sequence(state.mark_count_ , no_fill)332 state.extras_->sub_match_stack_.push_sequence(state.mark_count_) 333 333 , state.context_.results_ptr_->nested_results().size() 334 334 , state.action_list_.next 335 335 , state.action_list_tail_ -
boost/xpressive/detail/core/sub_match_impl.hpp
23 23 // need is trivial constructor/destructor. (???) 24 24 25 25 /////////////////////////////////////////////////////////////////////////////// 26 // sub_match_impl_default 27 // 28 struct sub_match_impl_default 29 { 30 }; 31 32 /////////////////////////////////////////////////////////////////////////////// 26 33 // sub_match_impl 27 34 // 28 35 template<typename BidiIter> … … 40 47 , zero_width_(false) 41 48 { 42 49 } 50 51 sub_match_impl &operator =(sub_match_impl_default const &) 52 { 53 this->matched = false; 54 this->repeat_count_ = 0; 55 this->zero_width_ = false; 56 return *this; 57 } 43 58 }; 44 59 45 60 }}} // namespace boost::xpressive::detail -
boost/xpressive/match_results.hpp
410 410 { 411 411 extras_type &extras = this->get_extras_(); 412 412 std::size_t size = that.sub_matches_.size(); 413 detail::sub_match_impl<BidiIter> *sub_matches = extras.sub_match_stack_.push_sequence(size );413 detail::sub_match_impl<BidiIter> *sub_matches = extras.sub_match_stack_.push_sequence(size, detail::sub_match_impl_default()); 414 414 detail::core_access<BidiIter>::init_sub_match_vector(this->sub_matches_, sub_matches, size, that.sub_matches_); 415 415 416 416 // BUGBUG this doesn't share the extras::sequence_stack