Laboratorio 5
O objetivo deste exercício é colocar em prática conceitos de containers, iteradores e algoritmos da STL (StandardTemplateLibrary)nalinguagemdeprogramaçãoC++.
Main Page
Classes
Files
File List
include
prog2
print.h
1
# ifndef PRINT_H_
2
# define PRINT_H_
3
4
using
std::cout;
5
using
std::endl;
6
using
std::set;
7
8
10
template
<
typename
TContainer>
11
void
print_elements(
const
TContainer& collection,
const
char
* label=
""
,
const
char
separator=
' '
)
12
{
13
cout<<label;
14
for
(
auto
i = collection.begin(); i != collection.end(); i++)
15
{
16
cout<<*i<<separator;
17
18
}
19
cout<<endl;
20
}
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# endif
Generated on Mon Nov 6 2017 09:40:07 for Laboratorio 5 by
1.8.11