| 794 | } |
| 795 | |
| 796 | bool SC::VectorTest::vectorSnippet() |
| 797 | { |
| 798 | Console console; |
| 799 | //! [VectorSnippet] |
| 800 | Vector<int> myVector; |
| 801 | SC_TRY(myVector.reserve(10)); |
| 802 | SC_TRY(myVector.push_back(1)); |
| 803 | console.print("[0]={}", myVector[0]); |
| 804 | SC_TRY(myVector.push_back(2)); |
| 805 | SC_TRY(myVector.pop_back()); |
| 806 | SC_TRY(myVector.pop_front()); |
| 807 | console.print("Vector<int> is {}", myVector.isEmpty() ? "empty" : "not empty"); |
| 808 | //! [VectorSnippet] |
| 809 | return true; |
| 810 | } |
| 811 | |
| 812 | namespace SC |
| 813 | { |