From 00aba02378ac8be31eb00ee61a8f45997b2d74c0 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 23 Oct 2025 19:36:55 +0200 Subject: fix: use string for filenames --- 2016/src/day01.cpp | 2 +- 2016/src/day02.cpp | 2 +- 2016/src/day03.cpp | 2 +- 2016/src/day04.cpp | 2 +- 2016/src/day06.cpp | 2 +- 2016/src/day07.cpp | 2 +- 2016/src/day08.cpp | 2 +- 2016/src/day09.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to '2016') diff --git a/2016/src/day01.cpp b/2016/src/day01.cpp index f5d74a5..6e5b720 100644 --- a/2016/src/day01.cpp +++ b/2016/src/day01.cpp @@ -30,7 +30,7 @@ split(string_view line, string_view delimiter) } vector> -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; string content{ istreambuf_iterator{ input }, istreambuf_iterator{} }; diff --git a/2016/src/day02.cpp b/2016/src/day02.cpp index 612de28..6d10bab 100644 --- a/2016/src/day02.cpp +++ b/2016/src/day02.cpp @@ -8,7 +8,7 @@ using namespace std; vector -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; vector lines; diff --git a/2016/src/day03.cpp b/2016/src/day03.cpp index fad26b8..5f3c58b 100644 --- a/2016/src/day03.cpp +++ b/2016/src/day03.cpp @@ -8,7 +8,7 @@ using namespace std; vector> -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; vector> result; diff --git a/2016/src/day04.cpp b/2016/src/day04.cpp index 713b16f..e4c292b 100644 --- a/2016/src/day04.cpp +++ b/2016/src/day04.cpp @@ -17,7 +17,7 @@ split(const string& line, const regex& sep) } vector, long, string>> -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; diff --git a/2016/src/day06.cpp b/2016/src/day06.cpp index 32bf9cc..75592ca 100644 --- a/2016/src/day06.cpp +++ b/2016/src/day06.cpp @@ -11,7 +11,7 @@ using namespace std; vector -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; diff --git a/2016/src/day07.cpp b/2016/src/day07.cpp index faa306f..781214a 100644 --- a/2016/src/day07.cpp +++ b/2016/src/day07.cpp @@ -8,7 +8,7 @@ using namespace std; vector -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; diff --git a/2016/src/day08.cpp b/2016/src/day08.cpp index ab3fc88..fdc09c1 100644 --- a/2016/src/day08.cpp +++ b/2016/src/day08.cpp @@ -8,7 +8,7 @@ using namespace std; vector> -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; diff --git a/2016/src/day09.cpp b/2016/src/day09.cpp index 10bf640..825fb05 100644 --- a/2016/src/day09.cpp +++ b/2016/src/day09.cpp @@ -4,7 +4,7 @@ using namespace std; string -read_file(string_view filename) +read_file(const string& filename) { fstream input{ filename }; string line; -- cgit v1.3