📜  c++ std::copy to cout - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:55.856000             🧑  作者: Mango

代码示例1
//it_start and it_end are the start and end iterators of your container
//(ie. vec.begin() and vec.end())
//T is the type of your container (for example, for a std::vector then
//T is int)
//separator is a string that will be inserted between each element

std::copy(it_start, it_end, std::ostream_iterator(std::cout, separator));