about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--day02.cc4
-rw-r--r--day04.cc6
2 files changed, 4 insertions, 6 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;
diff --git a/day04.cc b/day04.cc
index 85ae224..7d7d48b 100644
--- a/day04.cc
+++ b/day04.cc
@@ -34,11 +34,9 @@ main()
 
 	while (getline(cin, line)) {
 		istringstream is1{line}, is2{line};
-		set<string> words{istream_iterator<string>(is1),
-		    istream_iterator<string>()};
+		set<string> words{istream_iterator<string>(is1), {}};
 		anagram::set awords{words.cbegin(), words.cend()};
-		size_t wcount = distance(istream_iterator<string>(is2),
-		    istream_iterator<std::string>());
+		size_t wcount = distance(istream_iterator<string>(is2), {});
 
 		if (words.size() == wcount) p1++;
 		if (awords.size() == wcount) p2++;