Created
June 15, 2021 15:31
-
-
Save BogdanAriton/4155a33d674b5264b60e1630edb1b9f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() | |
{ | |
LinkedList<unsigned long long> longList = {12, 3123, 4324532, 4324231313, 54654645, 654768768, 4333423545, 12123423}; | |
for (const auto &item : longList) // each item returned will call the dereferencing operator on the iterator thus getting back the data from the node | |
{ | |
std::cout << item << '\n'; | |
} | |
// we can get an iterator that can be incremented | |
auto iterator = longList.begin(); | |
std::cout << "This is the second element: " << *(++iterator) << '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment