Changeset 8d25360 for src/Common
- Timestamp:
- Feb 13, 2019, 12:24:12 PM (6 years ago)
- Branches:
- no_list
- Children:
- 80eefcb
- Parents:
- bbbc067
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/utility.h
rbbbc067 r8d25360 94 94 template< typename SrcContainer, typename DestContainer > 95 95 void cloneAll( const SrcContainer &src, DestContainer &dest ) { 96 typename SrcContainer::const_iterator in = src.begin();97 std::back_insert_iterator< DestContainer > out( dest );98 while ( in != src.end() ) {99 *out++ = (*in++)->clone();100 } // while96 std::transform(src.begin(), src.end(), std::back_insert_iterator< DestContainer >( dest ), 97 [](const typename SrcContainer::value_type & t) -> typename DestContainer::value_type { 98 return t->clone(); 99 } 100 ); 101 101 } 102 102 … … 464 464 465 465 // ----------------------------------------------------------------------------- 466 /// Reorders the input range in-place so that the minimal-value elements according to the 467 /// comparator are in front; 466 /// Reorders the input range in-place so that the minimal-value elements according to the 467 /// comparator are in front; 468 468 /// returns the iterator after the last minimal-value element. 469 469 template<typename Iter, typename Compare> 470 470 Iter sort_mins( Iter begin, Iter end, Compare& lt ) { 471 471 if ( begin == end ) return end; 472 472 473 473 Iter min_pos = begin; 474 474 for ( Iter i = begin + 1; i != end; ++i ) {
Note: See TracChangeset
for help on using the changeset viewer.