1. STL

1.1. Containers

1.2. Algorithms

#include <algorithm>
#include <numeric>

std::accumulate

// 计算容器元素和, 初始值为 0
int sum = std::accumulate(nums.begin(), nums.end(), 0);
// 自定义二元操作(字符串拼接)
std::string sentence = std::accumulate(words.begin(), words.end(),
    std::string(""),
    [](std::string acc, const std::string& wokd) {
        return acc + " " + word;
    }
);

std::transform

std::partition

std::unique

std::advance

1.3. Iterators

1.4. Functors

1.5. Adapters

1.6. References

Copyright © gendloop 2024 all right reserved,powered by Gitbook该文件修订时间: 2026-02-10 13:48:53

results matching ""

    No results matching ""