std::deque

cppreference.com

Example

main: () = {
    // Create a deque containing integers
    d: std::deque = (7, 5, 16, 8);
 
    // Add an integer to the beginning and end of the deque
    d.push_front(13);
    d.push_back(25);
 
    // Iterate and print values of deque
    for d do (n) {
        std::cout << "(n)$ ";
    }
    std::cout << '\n';
}

Output

13 7 5 16 8 25 

Back to top

cpp2reference.com licensed under CC-BY-SA and GFDL.