@@ -322,10 +322,11 @@ namespace eastl
322322 typedef typename eastl::iterator_traits<RandomAccessIterator>::difference_type difference_type;
323323 typedef typename eastl::iterator_traits<RandomAccessIterator>::value_type value_type;
324324
325- const value_type tempBottom (*(last - 1 ));
325+ value_type tempBottom (eastl::forward<value_type>( *(last - 1 ) ));
326326
327- eastl::promote_heap<RandomAccessIterator, difference_type, value_type, Compare>
328- (first, (difference_type)0 , (difference_type)(last - first - 1 ), tempBottom, compare);
327+ eastl::promote_heap<RandomAccessIterator, difference_type, value_type, Compare>(
328+ first, (difference_type)0 , (difference_type)(last - first - 1 ), eastl::forward<value_type>(tempBottom),
329+ compare);
329330 }
330331
331332
@@ -505,8 +506,9 @@ namespace eastl
505506
506507 const value_type tempBottom (*(first + heapSize - 1 ));
507508 *(first + heapSize - 1 ) = *(first + position);
508- eastl::adjust_heap<RandomAccessIterator, difference_type, value_type>
509- (first, (difference_type)0 , (difference_type)(heapSize - 1 ), (difference_type)position, tempBottom);
509+ eastl::adjust_heap<RandomAccessIterator, difference_type, value_type>(
510+ first, (difference_type)0 , (difference_type)(heapSize - 1 ), (difference_type)position,
511+ eastl::forward<const value_type>(tempBottom));
510512 }
511513
512514
@@ -526,10 +528,11 @@ namespace eastl
526528 typedef typename eastl::iterator_traits<RandomAccessIterator>::difference_type difference_type;
527529 typedef typename eastl::iterator_traits<RandomAccessIterator>::value_type value_type;
528530
529- const value_type tempBottom (*(first + heapSize - 1 ));
531+ value_type tempBottom (*(first + heapSize - 1 ));
530532 *(first + heapSize - 1 ) = *(first + position);
531- eastl::adjust_heap<RandomAccessIterator, difference_type, value_type, Compare>
532- (first, (difference_type)0 , (difference_type)(heapSize - 1 ), (difference_type)position, tempBottom, compare);
533+ eastl::adjust_heap<RandomAccessIterator, difference_type, value_type, Compare>(
534+ first, (difference_type)0 , (difference_type)(heapSize - 1 ), (difference_type)position,
535+ eastl::forward<const value_type>(tempBottom), compare);
533536 }
534537
535538
@@ -554,8 +557,8 @@ namespace eastl
554557
555558 value_type tempBottom (*(first + heapSize - 1 ));
556559
557- eastl::promote_heap<RandomAccessIterator, difference_type, value_type>
558- ( first, (difference_type)0 , (difference_type)(heapSize - 1 ), tempBottom);
560+ eastl::promote_heap<RandomAccessIterator, difference_type, value_type>(
561+ first, (difference_type)0 , (difference_type)(heapSize - 1 ), eastl::forward< const value_type>( tempBottom) );
559562 }
560563
561564
@@ -574,8 +577,9 @@ namespace eastl
574577
575578 value_type tempBottom (*(first + heapSize - 1 ));
576579
577- eastl::promote_heap<RandomAccessIterator, difference_type, value_type, Compare>
578- (first, (difference_type)0 , (difference_type)(heapSize - 1 ), tempBottom, compare);
580+ eastl::promote_heap<RandomAccessIterator, difference_type, value_type, Compare>(
581+ first, (difference_type)0 , (difference_type)(heapSize - 1 ), eastl::forward<const value_type>(tempBottom),
582+ compare);
579583 }
580584
581585
0 commit comments