From 9f37789e7883c9aece3a5f90445836adefb23056 Mon Sep 17 00:00:00 2001 From: admiswalker Date: Sun, 17 Apr 2022 03:33:11 +0900 Subject: [PATCH] fix comment --- sstd/src/math.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sstd/src/math.hpp b/sstd/src/math.hpp index ad028cf0..19c15993 100755 --- a/sstd/src/math.hpp +++ b/sstd/src/math.hpp @@ -162,6 +162,7 @@ namespace sstd{ template uint argnearest_up (const std::vector& v, const T& value); //----------------------------------------------------------------------------------------------------------------------------------------------- + // sort template inline void sort ( std::vector& rhs ){ std::sort(rhs.begin(), rhs.end()); } // Ascending: 昇順: 0, 1, 2, ... template inline std::vector sorted (const std::vector& rhs_in){ std::vector rhs=rhs_in; std::sort(rhs.begin(), rhs.end()); return rhs; } // Ascending: 昇順: 0, 1, 2, ... @@ -171,7 +172,7 @@ namespace sstd{ template inline std::vector sorted_gr( std::vector&& rhs ){ std::sort(rhs.begin(), rhs.end(), std::greater()); return rhs; } // Descending: 降順: 9, 8, 7, ... //----------------------------------------------------------------------------------------------------------------------------------------------- - // multi vector sort + // sort for multiple vector class sstd_mult_vec_sort{ private: @@ -204,7 +205,7 @@ namespace sstd{ sstd::_sort(s, std::forward(tail)...); } template - inline void sort_gr(Head&& head, Tail&&... tail){ // Ascending: 昇順: 0, 1, 2, ... + inline void sort_gr(Head&& head, Tail&&... tail){ // Descending: 降順: 9, 8, 7, ... class sstd_mult_vec_sort s(head.size()); std::iota(s.idx.begin(), s.idx.end(), 0); std::sort(s.idx.begin(), s.idx.end(), [&](uint lhs, uint rhs) -> bool { return !(head[lhs] < head[rhs]); });