chore: use c++ 11

This commit is contained in:
Youwen Wu 2025-01-17 14:31:47 -08:00
parent e7be1ed974
commit 11712ab019
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@ project(
'cs010b-work', 'cs010b-work',
'cpp', 'cpp',
version: '0.1', version: '0.1',
default_options: ['warning_level=3', 'cpp_std=c++23'], default_options: ['warning_level=3', 'cpp_std=c++11'],
) )
c_1_lab_1 = executable('c_1_lab_1', 'src/chapter_1/c_1_lab_1.cpp', install: true) c_1_lab_1 = executable('c_1_lab_1', 'src/chapter_1/c_1_lab_1.cpp', install: true)

View file

@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
input.close(); input.close();
// Get integer average of all values read in. // Get integer average of all values read in.
int sum = std::accumulate(values.begin(), values.end(), 0); int sum = std::accumulate(values.begin(), values.end(), 0, std::plus<int>());
int average = sum / static_cast<int>(values.size()); int average = sum / static_cast<int>(values.size());
// Convert each value within vector to be the difference between the original // Convert each value within vector to be the difference between the original