@@ -43,6 +43,7 @@ SOFTWARE.
4343#include " iterator.h"
4444#include " functional.h"
4545#include " utility.h"
46+ #include " largest.h"
4647#include " gcd.h"
4748#include " error_handler.h"
4849#include " exception.h"
@@ -952,12 +953,12 @@ namespace etl
952953
953954 while ((value_index > top_index) && compare (first[parent], value))
954955 {
955- first[value_index] = etl::move (first[parent]);
956+ first[value_index] = ETL_MOVE (first[parent]);
956957 value_index = parent;
957958 parent = (value_index - 1 ) / 2 ;
958959 }
959960
960- first[value_index] = etl::move (value);
961+ first[value_index] = ETL_MOVE (value);
961962 }
962963
963964 // Adjust Heap Helper
@@ -974,18 +975,18 @@ namespace etl
974975 --child2nd;
975976 }
976977
977- first[value_index] = etl::move (first[child2nd]);
978+ first[value_index] = ETL_MOVE (first[child2nd]);
978979 value_index = child2nd;
979980 child2nd = 2 * (child2nd + 1 );
980981 }
981982
982983 if (child2nd == length)
983984 {
984- first[value_index] = etl::move (first[child2nd - 1 ]);
985+ first[value_index] = ETL_MOVE (first[child2nd - 1 ]);
985986 value_index = child2nd - 1 ;
986987 }
987988
988- push_heap (first, value_index, top_index, etl::move (value), compare);
989+ push_heap (first, value_index, top_index, ETL_MOVE (value), compare);
989990 }
990991
991992 // Is Heap Helper
@@ -1018,10 +1019,10 @@ namespace etl
10181019 typedef typename etl::iterator_traits<TIterator>::value_type value_t ;
10191020 typedef typename etl::iterator_traits<TIterator>::difference_type distance_t ;
10201021
1021- value_t value = etl::move (last[-1 ]);
1022- last[-1 ] = etl::move (first[0 ]);
1022+ value_t value = ETL_MOVE (last[-1 ]);
1023+ last[-1 ] = ETL_MOVE (first[0 ]);
10231024
1024- private_heap::adjust_heap (first, distance_t (0 ), distance_t (last - first - 1 ), etl::move (value), compare);
1025+ private_heap::adjust_heap (first, distance_t (0 ), distance_t (last - first - 1 ), ETL_MOVE (value), compare);
10251026 }
10261027
10271028 // Pop Heap
@@ -1040,7 +1041,7 @@ namespace etl
10401041 typedef typename etl::iterator_traits<TIterator>::difference_type difference_t ;
10411042 typedef typename etl::iterator_traits<TIterator>::value_type value_t ;
10421043
1043- private_heap::push_heap (first, difference_t (last - first - 1 ), difference_t (0 ), value_t (etl::move (*(last - 1 ))), compare);
1044+ private_heap::push_heap (first, difference_t (last - first - 1 ), difference_t (0 ), value_t (ETL_MOVE (*(last - 1 ))), compare);
10441045 }
10451046
10461047 // Push Heap
@@ -1068,7 +1069,7 @@ namespace etl
10681069
10691070 while (true )
10701071 {
1071- private_heap::adjust_heap (first, parent, length, etl::move (*(first + parent)), compare);
1072+ private_heap::adjust_heap (first, parent, length, ETL_MOVE (*(first + parent)), compare);
10721073
10731074 if (parent == 0 )
10741075 {
@@ -1205,7 +1206,7 @@ namespace etl
12051206
12061207 for (int i = 0 ; i < gcd_nm; i++)
12071208 {
1208- value_type temp = etl::move (*(first + i));
1209+ value_type temp = ETL_MOVE (*(first + i));
12091210 int j = i;
12101211
12111212 while (true )
@@ -1222,11 +1223,11 @@ namespace etl
12221223 break ;
12231224 }
12241225
1225- *(first + j) = etl::move (*(first + k));
1226+ *(first + j) = ETL_MOVE (*(first + k));
12261227 j = k;
12271228 }
12281229
1229- *(first + j) = etl::move (temp);
1230+ *(first + j) = ETL_MOVE (temp);
12301231 }
12311232
12321233 return result;
@@ -1347,13 +1348,13 @@ namespace etl
13471348 typedef typename etl::iterator_traits<TIterator>::value_type value_type;
13481349
13491350 // Save the first item.
1350- value_type temp (etl::move (*first));
1351+ value_type temp (ETL_MOVE (*first));
13511352
13521353 // Move the rest.
13531354 TIterator result = etl::move (etl::next (first), last, first);
13541355
13551356 // Restore the first item in its rotated position.
1356- *result = etl::move (temp);
1357+ *result = ETL_MOVE (temp);
13571358
13581359 // The new position of the first item.
13591360 return result;
@@ -1369,13 +1370,13 @@ namespace etl
13691370
13701371 // Save the last item.
13711372 TIterator previous = etl::prev (last);
1372- value_type temp (etl::move (*previous));
1373+ value_type temp (ETL_MOVE (*previous));
13731374
13741375 // Move the rest.
13751376 TIterator result = etl::move_backward (first, previous, last);
13761377
13771378 // Restore the last item in its rotated position.
1378- *first = etl::move (temp);
1379+ *first = ETL_MOVE (temp);
13791380
13801381 // The new position of the first item.
13811382 return result;
@@ -2150,7 +2151,7 @@ namespace etl
21502151 {
21512152 while (first != last)
21522153 {
2153- sum = etl::move (sum) + *first;
2154+ sum = ETL_MOVE (sum) + *first;
21542155 ++first;
21552156 }
21562157
@@ -2167,7 +2168,7 @@ namespace etl
21672168 {
21682169 while (first != last)
21692170 {
2170- sum = operation (etl::move (sum), *first);
2171+ sum = operation (ETL_MOVE (sum), *first);
21712172 ++first;
21722173 }
21732174
@@ -2224,7 +2225,7 @@ namespace etl
22242225 {
22252226 if (!(*itr == value))
22262227 {
2227- *first++ = etl::move (*itr);
2228+ *first++ = ETL_MOVE (*itr);
22282229 }
22292230 }
22302231 }
@@ -2250,7 +2251,7 @@ namespace etl
22502251 {
22512252 if (!predicate (*itr))
22522253 {
2253- *first++ = etl::move (*itr);
2254+ *first++ = ETL_MOVE (*itr);
22542255 }
22552256 }
22562257 }
@@ -2280,14 +2281,19 @@ namespace etl
22802281 ETL_CONSTEXPR14
22812282 typename etl::enable_if<etl::is_random_iterator<TInputIterator>::value &&
22822283 etl::is_random_iterator<TOutputIterator>::value, TOutputIterator>::type
2283- copy_s (TInputIterator i_begin,
2284- TInputIterator i_end,
2285- TOutputIterator o_begin,
2286- TOutputIterator o_end)
2284+ copy_s (TInputIterator i_begin,
2285+ TInputIterator i_end,
2286+ TOutputIterator o_begin,
2287+ TOutputIterator o_end)
22872288 {
2288- using s_size_type = typename iterator_traits<TInputIterator>::difference_type;
2289- using d_size_type = typename iterator_traits<TOutputIterator>::difference_type;
2290- using min_size_type = typename etl::common_type<s_size_type, d_size_type>::type;
2289+ typedef typename iterator_traits<TInputIterator>::difference_type s_size_type;
2290+ typedef typename iterator_traits<TOutputIterator>::difference_type d_size_type;
2291+
2292+ #if ETL_USING_CPP11
2293+ typedef typename etl::common_type<s_size_type, d_size_type>::type min_size_type;
2294+ #else
2295+ typedef typename etl::largest_type<s_size_type, d_size_type>::type min_size_type;
2296+ #endif
22912297
22922298 s_size_type s_size = etl::distance (i_begin, i_end);
22932299 ETL_ASSERT (s_size >= 0 , ETL_ERROR (algorithm_error));
0 commit comments