Generic operations on C++ containers

前端 未结 3 1911
旧巷少年郎
旧巷少年郎 2021-02-13 23:54

How to write generic operations on C++ STL containers? For example, Java has Collection interface, which every Java containers (except for maps) implements. I can do operations

3条回答
  •  盖世英雄少女心
    2021-02-14 00:09

    Look at the header . There are plenty of generic algorithms in there for finding, sorting, counting, copying, etc, that work on anything providing iterators with various specified characteristics.

提交回复
热议问题