修改print_container的接口
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <iterator>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "..\Algorithm.h"
|
||||
|
||||
@@ -10,8 +11,8 @@ namespace TinySTL{
|
||||
namespace Test{
|
||||
|
||||
template<class Container>
|
||||
void print_container(Container& container){//不是每一个容器都有const_iterator
|
||||
std::cout << "Container : ";
|
||||
void print_container(Container& container, const std::string& name = ""){//不是每一个容器都有const_iterator
|
||||
std::cout << "Container " << name << " :";
|
||||
for (auto val : container){
|
||||
std::cout << val << " ";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user