@@ -284,6 +284,7 @@ My favorite tool for this is the [`CHECK`](https://abseil.io/docs/cpp/guides/log
284284<!--
285285` CPP_SETUP_START `
286286#include <vector >
287+ #include <algorithm >
287288
288289#define CHECK_GE(expr, value)
289290#define CHECK_LT(expr, value)
@@ -357,6 +358,7 @@ First, we can use `assert` in a very similar way to `CHECK`:
357358<!--
358359`CPP_SETUP_START`
359360#include <vector>
361+ #include <algorithm>
360362
361363struct ChangeEntry {
362364 int index{};
@@ -515,6 +517,7 @@ In our example, we could throw an object of `std::out_of_range` when the user in
515517<!--
516518`CPP_SETUP_START`
517519#include <iostream>
520+ #include <vector>
518521
519522struct ChangeEntry {
520523 int index{};
@@ -554,6 +557,7 @@ Speaking of handling exceptions, we can "catch" them anywhere upstream from the
554557<!--
555558`CPP_SETUP_START`
556559#include <iostream>
560+ #include <vector>
557561
558562struct ChangeEntry {
559563 int index{};
@@ -650,6 +654,7 @@ In our own example, if, the `ChangePlayerNumberIfPossible` function throws an un
650654<!--
651655`CPP_SETUP_START`
652656#include <iostream>
657+ #include <vector>
653658
654659struct ChangeEntry {
655660 int index{};
@@ -730,6 +735,7 @@ There is a number of issues with returning a special value from a function witho
730735<!--
731736`CPP_SETUP_START`
732737#include <iostream>
738+ #include <vector>
733739
734740struct ChangeEntry {
735741 int index{};
@@ -825,6 +831,7 @@ Consider how we would use this function:
825831<!--
826832`CPP_SETUP_START`
827833#include <iostream>
834+ #include <vector>
828835
829836constexpr inline int kError = 1;
830837constexpr inline int kSuccess = 0;
@@ -891,6 +898,7 @@ I believe that there *is* a better way though. With C++17, we gained [`std::opti
891898<!--
892899`CPP_SETUP_START`
893900#include <iostream>
901+ #include <vector>
894902
895903constexpr inline int kError = 1;
896904constexpr inline int kSuccess = 0;
@@ -938,6 +946,7 @@ We can use our newly-returned optional object in an `if` statement to find out i
938946<!--
939947`CPP_SETUP_START`
940948#include <iostream>
949+ #include <vector>
941950
942951struct ChangeEntry {
943952 int index{};
0 commit comments