-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6.47.cpp
More file actions
32 lines (29 loc) · 650 Bytes
/
6.47.cpp
File metadata and controls
32 lines (29 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <vector>
#include <iostream>
#include <cassert>
using std::cout;
using std::endl;
using std::vector;
void print(vector<int>::const_iterator start, vector<int>::const_iterator end) {
#ifndef NDEBUG
cout << __func__ << " : size of vector: " << end - start << endl;
#endif
if (start != end) {
cout << *start << " ";
return print(start+1, end);
}
#ifdef NDEBUG
cout << endl;
#endif
return;
}
int main() {
#ifndef NDEBUG
cout << __FILE__ << " - compiled on " << __DATE__ << " at " << __TIME__ << endl;
#endif
vector<int> ivec;
for (int i = 0; i != 10; ++i)
ivec.push_back(i);
print(ivec.begin(), ivec.end());
return 0;
}