MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / arraySnippet

Method arraySnippet

Tests/Libraries/Containers/ArrayTest.cpp:197–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195};
196
197bool 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
215namespace SC
216{

Callers

nothing calls this directly

Calls 4

pop_backMethod · 0.80
printMethod · 0.80
push_backMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected