about summary refs log tree commit diff
path: root/day02.cc
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-12-05 16:07:34 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-12-05 16:07:34 +0100
commitdff16e900f2dd3e9e257a015d22bec6b73529cc7 (patch)
treecad4ad955744193d1d40e71558063615638d8b01 /day02.cc
parent73e28533374104587c3baf42b29ff6094f4d54b9 (diff)
downloadadventofcode2017-dff16e900f2dd3e9e257a015d22bec6b73529cc7.tar.gz
adventofcode2017-dff16e900f2dd3e9e257a015d22bec6b73529cc7.tar.xz
adventofcode2017-dff16e900f2dd3e9e257a015d22bec6b73529cc7.zip
use {} instead of istream_iterator()
Diffstat (limited to 'day02.cc')
-rw-r--r--day02.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/day02.cc b/day02.cc
index ba955ee..d19b454 100644
--- a/day02.cc
+++ b/day02.cc
@@ -13,9 +13,9 @@ int main()
 	int s1 = 0, s2 = 0;
 
 	while (getline(cin, line)) {
+		// slurp it for part 2
 		istringstream is{line};
-		vector<int> v{istream_iterator<int>(is),
-		    istream_iterator<int>()};   // slurp it for part 2
+		vector<int> v{istream_iterator<int>(is), {}};
 
 		auto [min, max] = minmax_element(begin(v), end(v));
 		s1 += *max - *min;