| 195 | }; |
| 196 | |
| 197 | bool SC::ArrayTest::arraySnippet() |
| 198 | { |
| 199 | Console console; |
| 200 | //! [ArraySnippet] |
| 201 | Array<int, 3> myVector; |
| 202 | SC_TRY(myVector.push_back(1)); |
| 203 | SC_TRY(myVector.push_back(2)); |
| 204 | SC_TRY(myVector.push_back(3)); |
| 205 | (void)myVector.push_back(4); // <-- This will fail |
| 206 | SC_TRY(myVector.pop_back()); |
| 207 | SC_TRY(myVector.pop_front()); |
| 208 | SC_TRY(myVector.pop_front()); |
| 209 | (void)myVector.pop_front(); // <-- This will fail |
| 210 | console.print("Array<int, 3> is {}", myVector.isEmpty() ? "empty" : "not empty"); |
| 211 | //! [ArraySnippet] |
| 212 | return true; |
| 213 | } |
| 214 | |
| 215 | namespace SC |
| 216 | { |