diff options
Diffstat (limited to 'c++-mode/ptn')
-rw-r--r-- | c++-mode/ptn | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/c++-mode/ptn b/c++-mode/ptn new file mode 100644 index 0000000..af9775e --- /dev/null +++ b/c++-mode/ptn @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: partition +# key: ptn +# contributor: Tommy BENNETT and Ludwig PACIFICI <ludwig@lud.cc> +# -- +auto pos = std::partition(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +if (pos != std::end($1)) { + $4 +} +$0 |