全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Generic algorithm?

Definition 5.5 University Computer Science — Year 2 · 第 5 章 — The Standard Library: Containers, Iterators and Algorithms

A generic algorithm of the standard library is a function template, declared in <algorithm> or <numeric>, that works on an iterator range rather than on a container, and requires of its iterators a category: std::find needs input iterators, std::sort random-access ones. Algorithms never add or remove elements of the container: they only read, write or reorder through the iterators.

在原文中阅读 →