Programming-Idioms

Implementation
C++

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Implementation edit is for fixing errors and enhancing with metadata.

Instead of changing the code of the snippet, consider creating another C++ implementation.

Other implementations
items.unshift(x);
items = append([]T{x}, items...)
items = append(items, x)
copy(items[1:], items)
items[0] = x
items = [x, items]
items.insert(0,x);
items.unshift(x)
items.prepend(x)
unshift @items, $x
items = [x] + items
#include <list>
items.push_front(x);
items = [x, ...items];
use std::collections::VecDeque;
items.push_front(x);
items2 = x : items