Khi đọc khoảng std::inclusive_scan, có vẻ như không có bất kỳ ví dụ nào.
Nó tấn công tôi rất giống với std::partial_sum.Sự khác nhau giữa std :: partial_sum và std :: inclusive_scan là gì?
partial_sum:
template< class InputIt, class OutputIt >
OutputIt partial_sum(InputIt first,
InputIt last, OutputIt d_first);
inclusive_scan:
template< class InputIt, class OutputIt >
OutputIt inclusive_scan(InputIt first,
InputIt last, OutputIt d_first);
Ai đó có thể xây dựng trên sự khác biệt của họ? Khi nào tôi sẽ chọn cái kia?