{"pageProps":{"code":{"CMakeLists.txt":{"name":"CMakeLists.txt","content":"add_executable(auto auto.cpp)\r\n\r\nadd_executable(basic1 basic1.cpp)\r\n\r\nadd_executable(basic2 basic2.cpp)\r\n\r\nadd_executable(const1 const1.cpp)\r\n\r\nadd_executable(const2 const2.cpp)\r\n\r\nadd_executable(convert-explicit convert-explicit.cpp)\r\n\r\nadd_executable(convert-implicit convert-implicit.cpp)\r\n\r\nadd_executable(declaration-definition declaration-definition.cpp)\r\n\r\nadd_executable(enumerations enumerations.cpp)\r\n\r\nadd_executable(error-compile error-compile.cpp)\r\n\r\nadd_executable(error-link error-link.cpp)\r\n\r\nadd_executable(error-logic error-logic.cpp)\r\n\r\nadd_executable(error-runtime error-runtime.cpp)\r\n\r\nadd_executable(expression-boolean expression-boolean.cpp)\r\n\r\nadd_executable(expression-floating expression-floating.cpp)\r\n\r\nadd_executable(expression-integral expression-integral.cpp)\r\n\r\nadd_executable(expression-string expression-string.cpp)\r\n\r\nadd_executable(file-io file-io.cpp)\r\n\r\nadd_executable(for-range for-range.cpp)\r\n\r\nadd_executable(for-statements for-statements.cpp)\r\n\r\nadd_executable(function-overloading-resolution function-overloading-resolution.cpp)\r\n\r\nadd_executable(function-overloading function-overloading.cpp)\r\n\r\nadd_executable(function-parameters function-parameters.cpp)\r\n\r\nadd_executable(function-syntax function-syntax.cpp)\r\n\r\nadd_executable(function-types function-types.cpp)\r\n\r\nadd_executable(hash-map hash-map.cpp)\r\n\r\nadd_executable(if-basic if-basic.cpp)\r\n\r\nadd_executable(if-short if-short.cpp)\r\n\r\nadd_executable(if-switch if-switch.cpp)\r\n\r\nadd_executable(pass-by-reference-new pass-by-reference-new.cpp)\r\n\r\nadd_executable(pass-by-reference-old pass-by-reference-old.cpp)\r\n\r\nadd_executable(pass-by-value pass-by-value.cpp)\r\n\r\nadd_executable(references-more references-more.cpp)\r\n\r\nadd_executable(references references.cpp)\r\n\r\nadd_executable(sequenced-collections sequenced-collections.cpp)\r\n\r\nadd_executable(system-specific system-specific.cpp)\r\n\r\nadd_executable(value-reference-performance value-reference-performance.cpp)\r\n\r\nadd_executable(value-semantics value-semantics.cpp)\r\n\r\n","path":"code/6771/24T2/1.2/CMakeLists.txt","fileext":"txt"},"auto.cpp":{"name":"auto.cpp","content":"int main()\r\n{\r\n    auto i = 0; // i is an int\r\n    auto j = 8.5; // j is a double\r\n    auto k = false; // k is a bool\r\n    (void)i;\r\n    (void)j;\r\n    (void)k;\r\n}","path":"code/6771/24T2/1.2/auto.cpp","fileext":"cpp"},"basic1.cpp":{"name":"basic1.cpp","content":"int main()\r\n{\r\n    // `int` for integers.\r\n    int meaning_of_life = 42;\r\n\r\n    // `double` for rational numbers.\r\n    double six_feet_in_metres = 1.8288;\r\n\r\n    // `char` for single characters.\r\n    char letter = 'C';\r\n\r\n    (void)meaning_of_life;\r\n    (void)six_feet_in_metres;\r\n    (void)letter;\r\n}\r\n","path":"code/6771/24T2/1.2/basic1.cpp","fileext":"cpp"},"basic2.cpp":{"name":"basic2.cpp","content":"#include <string>\r\n\r\nint main()\r\n{\r\n    // `string` for text.\r\n    std::string course_code = std::string(\"COMP6771\");\r\n\r\n    // `bool` for truth\r\n    bool is_cxx = true;\r\n    bool is_danish = false;\r\n\r\n    (void)is_cxx;\r\n    (void)is_danish;\r\n}\r\n","path":"code/6771/24T2/1.2/basic2.cpp","fileext":"cpp"},"const1.cpp":{"name":"const1.cpp","content":"int main()\r\n{\r\n    // `int` for integers.\r\n    auto const meaning_of_life = 42;\r\n\r\n    // `double` for rational numbers.\r\n    auto const six_feet_in_metres = 1.8288;\r\n\r\n    (void)meaning_of_life;\r\n    (void)six_feet_in_metres;\r\n\r\n    // meaning_of_life++; // COMPILE ERROR HERE\r\n}","path":"code/6771/24T2/1.2/const1.cpp","fileext":"cpp"},"const2.cpp":{"name":"const2.cpp","content":"int main()\r\n{\r\n    auto const meaning_of_life1 = 42; // good\r\n    const auto meaning_of_life2 = 42; // bad\r\n    (void)meaning_of_life1;\r\n    (void)meaning_of_life2;\r\n}","path":"code/6771/24T2/1.2/const2.cpp","fileext":"cpp"},"convert-explicit.cpp":{"name":"convert-explicit.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto const i = 0;\r\n    {\r\n        // Preferred over implicit, since your intention is clear\r\n        auto const d = static_cast<double>(i);\r\n        CHECK(d == 42.0);\r\n        CHECK(d != 41);\r\n    }\r\n}","path":"code/6771/24T2/1.2/convert-explicit.cpp","fileext":"cpp"},"convert-implicit.cpp":{"name":"convert-implicit.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto const i = 0;\r\n    {\r\n        auto d = 0.0;\r\n        REQUIRE(d == 0.0);\r\n\r\n        d = i; // Silent conversion from int to double\r\n        CHECK(d == 42.0);\r\n        CHECK(d != 41);\r\n    }\r\n}","path":"code/6771/24T2/1.2/convert-implicit.cpp","fileext":"cpp"},"declaration-definition.cpp":{"name":"declaration-definition.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nvoid declared_fn(int arg);\r\nclass declared_type;\r\n\r\n// This class is defined, but not all the methods are.\r\nclass defined_type {\r\n    int declared_member_fn(double);\r\n    int defined_member_fn(int arg) { return arg; }\r\n};\r\n\r\n// These are all defined.\r\nint defined_fn(int arg)\r\n{\r\n    (void)arg;\r\n    return 1;\r\n}\r\n\r\nTEST_CASE()\r\n{\r\n    int i;\r\n    int const j = 1;\r\n    auto vd = std::vector<double> {};\r\n    (void)i;\r\n    (void)j;\r\n    (void)vd;\r\n}","path":"code/6771/24T2/1.2/declaration-definition.cpp","fileext":"cpp"},"enumerations.cpp":{"name":"enumerations.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    enum class computing_courses {\r\n        intro,\r\n        data_structures,\r\n        engineering_design,\r\n        compilers,\r\n        cplusplus,\r\n    };\r\n\r\n    auto const computing101 = computing_courses::intro;\r\n    auto const computing102 = computing_courses::data_structures;\r\n    CHECK(computing101 != computing102);\r\n}","path":"code/6771/24T2/1.2/enumerations.cpp","fileext":"cpp"},"error-compile.cpp":{"name":"error-compile.cpp","content":"auto main() -> int\r\n{\r\n    // a = 5; // Compile-time error: type not specified\r\n    // (void) a;\r\n}","path":"code/6771/24T2/1.2/error-compile.cpp","fileext":"cpp"},"error-link.cpp":{"name":"error-link.cpp","content":"#include <iostream>\r\n\r\nauto is_cs6771() -> bool;\r\n\r\nint main()\r\n{\r\n    // std::cout << is_cs6771() << \"\\n\";\r\n}","path":"code/6771/24T2/1.2/error-link.cpp","fileext":"cpp"},"error-logic.cpp":{"name":"error-logic.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto const empty = std::string(\"\");\r\n    CHECK(empty[0] == 'C'); // Logic error: bad character access\r\n}","path":"code/6771/24T2/1.2/error-logic.cpp","fileext":"cpp"},"error-runtime.cpp":{"name":"error-runtime.cpp","content":"#include <fstream>\r\n#include <stdexcept>\r\n\r\nint main()\r\n{\r\n    // attempting to open a file...\r\n    if (auto file = std::ifstream(\"hello.txt\"); not file) {\r\n        throw std::runtime_error(\"Error: file not found.\\n\");\r\n    }\r\n}","path":"code/6771/24T2/1.2/error-runtime.cpp","fileext":"cpp"},"expression-boolean.cpp":{"name":"expression-boolean.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nauto const is_comp6771 = true;\r\nauto const is_about_cxx = true;\r\nauto const is_about_german = false;\r\n\r\nTEST_CASE()\r\n{\r\n    CHECK((is_comp6771 and is_about_cxx));\r\n    CHECK((is_about_german or is_about_cxx));\r\n    CHECK(not is_about_german);\r\n}\r\n\r\n// You can use classic && or || as well\r\n","path":"code/6771/24T2/1.2/expression-boolean.cpp","fileext":"cpp"},"expression-floating.cpp":{"name":"expression-floating.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto const x = 15.63;\r\n    auto const y = 1.23;\r\n\r\n    auto const sum = 16.86;\r\n    CHECK(x + y == sum);\r\n\r\n    auto const difference = 14.4;\r\n    CHECK(x - y == difference);\r\n    CHECK(y - x == -difference);\r\n\r\n    auto const product = 19.2249;\r\n    CHECK(x * y == product);\r\n\r\n    auto const expected = 12.7073170732;\r\n    auto const actual = x / y;\r\n    auto const acceptable_delta = 0.0000001;\r\n    CHECK(std::abs(expected - actual) < acceptable_delta);\r\n}","path":"code/6771/24T2/1.2/expression-floating.cpp","fileext":"cpp"},"expression-integral.cpp":{"name":"expression-integral.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto const x = 10;\r\n    auto const y = 173;\r\n\r\n    auto const sum = 183;\r\n    CHECK(x + y == sum);\r\n\r\n    auto const difference = 163;\r\n    CHECK(y - x == difference);\r\n    CHECK(x - y == -difference);\r\n\r\n    auto const product = 1730;\r\n    CHECK(x * y == product);\r\n\r\n    auto const quotient = 17;\r\n    CHECK(y / x == quotient);\r\n\r\n    auto const remainder = 3;\r\n    CHECK(y % x == remainder);\r\n}","path":"code/6771/24T2/1.2/expression-integral.cpp","fileext":"cpp"},"expression-string.cpp":{"name":"expression-string.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n\r\n    auto const expr = std::string(\"Hello, expressions!\");\r\n    auto const cxx = std::string(\"Hello, C++!\");\r\n\r\n    CHECK(expr != cxx);\r\n    CHECK(expr.front() == cxx[0]);\r\n\r\n    auto expr2 = expr;\r\n\r\n    // Abort TEST_CASE if expression is false\r\n    REQUIRE(expr == expr2);\r\n}","path":"code/6771/24T2/1.2/expression-string.cpp","fileext":"cpp"},"file-io.cpp":{"name":"file-io.cpp","content":"#include <fstream>\r\n#include <iostream>\r\n\r\nint main()\r\n{\r\n    // Below line only works C++17\r\n    std::ofstream fout { \"data.out\" };\r\n    if (auto in = std::ifstream { \"data.in\" }; in) { // attempts to open file, checks it was opened\r\n        for (auto i = 0; in >> i;) { // reads in\r\n            std::cout << i << '\\n';\r\n            fout << i;\r\n        }\r\n        if (in.bad()) {\r\n            std::cerr << \"unrecoverable error (e.g. disk disconnected?)\\n\";\r\n        } else if (not in.eof()) {\r\n            std::cerr << \"bad input: didn't read an int\\n\";\r\n        }\r\n    } // closes file automatically <-- no need to close manually!\r\n    else {\r\n        std::cerr << \"unable to read data.in\\n\";\r\n    }\r\n    fout.close();\r\n}","path":"code/6771/24T2/1.2/file-io.cpp","fileext":"cpp"},"for-range.cpp":{"name":"for-range.cpp","content":"#include <string>\r\n#include <vector>\r\n\r\nauto all_computer_scientists(std::vector<std::string> const& names) -> bool\r\n{\r\n    auto const famous_mathematician = std::string(\"Gauss\");\r\n    auto const famous_physicist = std::string(\"Newton\");\r\n\r\n    for (auto const& name : names) {\r\n        if (name == famous_mathematician or name == famous_physicist) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nint main()\r\n{\r\n}","path":"code/6771/24T2/1.2/for-range.cpp","fileext":"cpp"},"for-statements.cpp":{"name":"for-statements.cpp","content":"auto square(int n)\r\n{\r\n    return n * n;\r\n}\r\n\r\nauto cube(int n)\r\n{\r\n    return n * n * n;\r\n}\r\n\r\nauto square_vs_cube() -> bool\r\n{\r\n    // 0 and 1 are special cases, since they're actually equal.\r\n    if (square(0) != cube(0) or square(1) != cube(1)) {\r\n        return false;\r\n    }\r\n\r\n    for (auto i = 2; i < 100; ++i) {\r\n        if (square(i) == cube(i)) {\r\n            return false;\r\n        }\r\n    }\r\n\r\n    return true;\r\n}","path":"code/6771/24T2/1.2/for-statements.cpp","fileext":"cpp"},"function-overloading-resolution.cpp":{"name":"function-overloading-resolution.cpp","content":"/*\r\nauto g() -> void;\r\nauto f(int) -> void;\r\nauto f(int, int) -> void;\r\nauto f(double, double = 3.14) -> void;\r\nf(5.6); // calls f(double, double)\r\n*/","path":"code/6771/24T2/1.2/function-overloading-resolution.cpp","fileext":"cpp"},"function-overloading.cpp":{"name":"function-overloading.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nauto square(int const x) -> int\r\n{\r\n    return x * x;\r\n}\r\n\r\nauto square(double const x) -> double\r\n{\r\n    return x * x;\r\n}\r\n\r\nTEST_CASE()\r\n{\r\n\r\n    CHECK(square(2) == 4);\r\n    CHECK(square(2.0) == 4.0);\r\n    CHECK(square(2.0) != 4);\r\n}","path":"code/6771/24T2/1.2/function-overloading.cpp","fileext":"cpp"},"function-parameters.cpp":{"name":"function-parameters.cpp","content":"#include <string>\r\n\r\nstd::string rgb(short r = 0, short g = 0, short b = 0)\r\n{\r\n    (void)r;\r\n    (void)g;\r\n    (void)b;\r\n    return \"\";\r\n}\r\n\r\nint main()\r\n{\r\n    rgb(); // rgb(0, 0, 0);\r\n    rgb(100); // Rgb(100, 0, 0);\r\n    rgb(100, 200); // Rgb(100, 200, 0)\r\n    // rgb(100, , 200);   // error\r\n}","path":"code/6771/24T2/1.2/function-parameters.cpp","fileext":"cpp"},"function-syntax.cpp":{"name":"function-syntax.cpp","content":"#include <iostream>\r\n\r\nauto main() -> int\r\n{\r\n    // put \"Hello world\\n\" to the character output\r\n    std::cout << \"Hello, world!\\n\";\r\n}\r\n\r\n/*#include <iostream>\r\n\r\nint main() {\r\n  // put \"Hello world\\n\" to the character output\r\n  std::cout << \"Hello, world!\\n\";\r\n}*/","path":"code/6771/24T2/1.2/function-syntax.cpp","fileext":"cpp"},"function-types.cpp":{"name":"function-types.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nbool is_about_cxx()\r\n{ // nullary functions (no parameters)\r\n    return true;\r\n}\r\n\r\nint square(int const x)\r\n{ // unary functions (one parameter)\r\n    return x * x;\r\n}\r\n\r\nint area(int const width, int const length)\r\n{ // binary functions (two parameters)\r\n    return width * length;\r\n}\r\n\r\nTEST_CASE()\r\n{\r\n    CHECK(is_about_cxx());\r\n    CHECK(square(2) == 4);\r\n    CHECK(area(2, 4) == 8);\r\n}","path":"code/6771/24T2/1.2/function-types.cpp","fileext":"cpp"},"hash-map.cpp":{"name":"hash-map.cpp","content":"#include <catch2/catch.hpp>\r\n#include <string>\r\n#include <unordered_map>\r\n\r\nauto check_code_mapping(\r\n    std::unordered_map<std::string, std::string> const& country_codes,\r\n    std::string const& code,\r\n    std::string const& name) -> void\r\n{\r\n    auto const country = country_codes.find(code);\r\n    REQUIRE(country != country_codes.end());\r\n\r\n    auto const [key, value] = *country;\r\n    CHECK(code == key);\r\n    CHECK(name == value);\r\n}\r\n\r\nTEST_CASE()\r\n{\r\n    auto country_codes = std::unordered_map<std::string, std::string> {\r\n        { \"AU\", \"Australia\" },\r\n        { \"NZ\", \"New Zealand\" },\r\n        { \"CK\", \"Cook Islands\" },\r\n        { \"ID\", \"Indonesia\" },\r\n        { \"DK\", \"Denmark\" },\r\n        { \"CN\", \"China\" },\r\n        { \"JP\", \"Japan\" },\r\n        { \"ZM\", \"Zambia\" },\r\n        { \"YE\", \"Yemen\" },\r\n        { \"CA\", \"Canada\" },\r\n        { \"BR\", \"Brazil\" },\r\n        { \"AQ\", \"Antarctica\" },\r\n    };\r\n    CHECK(country_codes.contains(\"AU\"));\r\n    CHECK(not country_codes.contains(\"DE\")); // Germany not present\r\n    country_codes.emplace(\"DE\", \"Germany\");\r\n    CHECK(country_codes.contains(\"DE\"));\r\n}\r\n","path":"code/6771/24T2/1.2/hash-map.cpp","fileext":"cpp"},"if-basic.cpp":{"name":"if-basic.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nauto collatz_point_if_statement(int const x) -> int\r\n{\r\n    if (x % 2 == 0) {\r\n        return x / 2;\r\n    }\r\n    return 3 * x + 1;\r\n}\r\n\r\nTEST_CASE()\r\n{\r\n    CHECK(collatz_point_if_statement(6) == 3);\r\n    CHECK(collatz_point_if_statement(5) == 16);\r\n}","path":"code/6771/24T2/1.2/if-basic.cpp","fileext":"cpp"},"if-short.cpp":{"name":"if-short.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nauto is_even(int const x) -> bool\r\n{\r\n    return x % 2 == 0;\r\n}\r\n\r\nauto collatz_point_conditional(int const x) -> int\r\n{\r\n    return is_even(x) ? x / 2\r\n                      : 3 * x + 1;\r\n}\r\n\r\nTEST_CASE()\r\n{\r\n    CHECK(collatz_point_conditional(6) == 3);\r\n    CHECK(collatz_point_conditional(5) == 16);\r\n}","path":"code/6771/24T2/1.2/if-short.cpp","fileext":"cpp"},"if-switch.cpp":{"name":"if-switch.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nauto is_digit(char const c) -> bool\r\n{\r\n    switch (c) {\r\n    case '0':\r\n        [[fallthrough]];\r\n    case '1':\r\n        [[fallthrough]];\r\n    case '2':\r\n        [[fallthrough]];\r\n    case '3':\r\n        [[fallthrough]];\r\n    case '4':\r\n        [[fallthrough]];\r\n    case '5':\r\n        [[fallthrough]];\r\n    case '6':\r\n        [[fallthrough]];\r\n    case '7':\r\n        [[fallthrough]];\r\n    case '8':\r\n        [[fallthrough]];\r\n    case '9':\r\n        return true;\r\n    default:\r\n        return false;\r\n    }\r\n}\r\n\r\nTEST_CASE()\r\n{\r\n    CHECK(is_digit('6'));\r\n    CHECK(not is_digit('A'));\r\n}","path":"code/6771/24T2/1.2/if-switch.cpp","fileext":"cpp"},"pass-by-reference-new.cpp":{"name":"pass-by-reference-new.cpp","content":"#include <iostream>\r\n\r\nauto swap(int& x, int& y) -> void\r\n{\r\n    auto const tmp = x;\r\n    x = y;\r\n    y = tmp;\r\n}\r\n\r\nauto main() -> int\r\n{\r\n    auto i = 1;\r\n    auto j = 2;\r\n    std::cout << i << ' ' << j << '\\n'; // 1 2\r\n    swap(i, j);\r\n    std::cout << i << ' ' << j << '\\n'; // 2 1\r\n}","path":"code/6771/24T2/1.2/pass-by-reference-new.cpp","fileext":"cpp"},"pass-by-reference-old.cpp":{"name":"pass-by-reference-old.cpp","content":"// C equivalent\r\n#include <stdio.h>\r\n\r\nvoid swap(int* x, int* y)\r\n{\r\n    auto const tmp = *x;\r\n    *x = *y;\r\n    *y = tmp;\r\n}\r\n\r\nint main()\r\n{\r\n    int i = 1;\r\n    int j = 2;\r\n    printf(\"%d %d\\n\", i, j);\r\n    swap(&i, &j);\r\n    printf(\"%d %d\\n\", i, j);\r\n}","path":"code/6771/24T2/1.2/pass-by-reference-old.cpp","fileext":"cpp"},"pass-by-value.cpp":{"name":"pass-by-value.cpp","content":"#include <iostream>\r\n\r\nauto swap(int x, int y) -> void\r\n{\r\n    auto const tmp = x;\r\n    x = y;\r\n    y = tmp;\r\n}\r\n\r\nauto main() -> int\r\n{\r\n    auto i = 1;\r\n    auto j = 2;\r\n    std::cout << i << ' ' << j << '\\n'; // prints 1 2\r\n    swap(i, j);\r\n    std::cout << i << ' ' << j << '\\n'; // prints 1 2... not swapped?\r\n}","path":"code/6771/24T2/1.2/pass-by-value.cpp","fileext":"cpp"},"references-more.cpp":{"name":"references-more.cpp","content":"#include <iostream>\r\n\r\nint main()\r\n{\r\n    auto i = 1;\r\n    auto const& ref = i;\r\n    std::cout << ref << '\\n';\r\n    i++; // This is fine\r\n    std::cout << ref << '\\n';\r\n    // ref++; // This is not\r\n\r\n    auto const j = 1;\r\n    auto const& jref = j; // this is allowed\r\n    // auto& ref = j; // not allowed\r\n    std::cout << jref << \"\\n\";\r\n}","path":"code/6771/24T2/1.2/references-more.cpp","fileext":"cpp"},"references.cpp":{"name":"references.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto i = 1;\r\n    auto& j = i;\r\n    j = 3;\r\n\r\n    CHECK(i == 3);\r\n}","path":"code/6771/24T2/1.2/references.cpp","fileext":"cpp"},"sequenced-collections.cpp":{"name":"sequenced-collections.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto const single_digits = std::vector<int> {\r\n        0, 1, 2, 3, 4, 5, 6, 7, 8, 9\r\n    };\r\n\r\n    auto more_single_digits = single_digits;\r\n    REQUIRE(single_digits == more_single_digits);\r\n\r\n    more_single_digits[2] = 0;\r\n    CHECK(single_digits != more_single_digits);\r\n\r\n    more_single_digits.push_back(0);\r\n    CHECK(more_single_digits.size() == 11);\r\n}","path":"code/6771/24T2/1.2/sequenced-collections.cpp","fileext":"cpp"},"system-specific.cpp":{"name":"system-specific.cpp","content":"#include <iostream>\r\n#include <limits>\r\n\r\nint main()\r\n{\r\n    std::cout << std::numeric_limits<int>::max() << \"\\n\";\r\n    std::cout << std::numeric_limits<int>::min() << \"\\n\";\r\n    std::cout << std::numeric_limits<double>::max() << \"\\n\";\r\n    std::cout << std::numeric_limits<double>::min() << \"\\n\";\r\n}\r\n","path":"code/6771/24T2/1.2/system-specific.cpp","fileext":"cpp"},"value-reference-performance.cpp":{"name":"value-reference-performance.cpp","content":"/*auto by_value(std::string const sentence) -> char;\r\n// takes ~153.67 ns\r\nby_value(two_kb_string);\r\n\r\nauto by_reference(std::string const& sentence) -> char;\r\n// takes ~8.33 ns\r\nby_reference(two_kb_string);\r\n\r\nauto by_value(std::vector<std::string> const long_strings) -> char;\r\n// takes ~2'920 ns\r\nby_value(sixteen_two_kb_strings);\r\n\r\nauto by_reference(std::vector<std::string> const& long_strings) -> char;\r\n// takes ~13 ns\r\nby_reference(sixteen_two_kb_strings);*/","path":"code/6771/24T2/1.2/value-reference-performance.cpp","fileext":"cpp"},"value-semantics.cpp":{"name":"value-semantics.cpp","content":"#include <catch2/catch.hpp>\r\n\r\nTEST_CASE()\r\n{\r\n    auto const hello = std::string(\"Hello!\");\r\n    auto hello2 = hello;\r\n\r\n    // Abort TEST_CASE if expression is false\r\n    REQUIRE(hello == hello2);\r\n\r\n    hello2.append(\"2\");\r\n    REQUIRE(hello != hello2);\r\n\r\n    CHECK(hello.back() == '!');\r\n    CHECK(hello2.back() == '2');\r\n}\r\n","path":"code/6771/24T2/1.2/value-semantics.cpp","fileext":"cpp"}}},"__N_SSG":true}