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
s = append(s, x)
classes
var
  L: TList;
  Item: Pointer;
...
  L.Add(Item);
...
$s[]=$x;
s << x
s ~= x;
s.append(x)
s.push(x)
s.push(x);
List;
ArrayList;
List<String> stringList = new ArrayList<>();
stringList.add("hello")
(conj s x)
real, allocatable, dimension(:) :: s

s = [s, x]
push @s, $x;
s.push_back(x);
s.Add(x)
using System.Collections.Generic;
s.Add(x);
s.add(x);
s[#s + 1] = x
table.insert(s, x)
#include <list>
s.emplace_back(x);
s = [...s, x];
xs = s ++ [x]