Skip to content

Commit e982ad4

Browse files
author
Kevin
committed
Corrected
1 parent 3688143 commit e982ad4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.color_coded
33
_vimrc_local.vim
44
*.o
5+
build/
56

67
## Ignore Visual Studio temporary files, build results, and
78
## files generated by popular Visual Studio add-ons.
@@ -277,4 +278,4 @@ __pycache__/
277278

278279
# Cake - Uncomment if you are using it
279280
# tools/**
280-
# !tools/packages.config
281+
# !tools/packages.config

8-writing_generic_functions/generics/median.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using std::isspace;
2323
template<class T>
2424
T median(vector<T> v) {
2525
typedef typename vector<T>::size_type vec_sz;
26+
vec_sz size = v.size();
2627
if (size == 0) {
2728
throw domain_error("Median of an empty vector");
2829
}
@@ -127,4 +128,4 @@ int main() {
127128
split(s, ostream_iterator<string>(cout, "\n"));
128129
}
129130
return 0;
130-
}
131+
}

0 commit comments

Comments
 (0)