summaryrefslogtreecommitdiff
path: root/c++-mode/ajf
diff options
context:
space:
mode:
Diffstat (limited to 'c++-mode/ajf')
-rw-r--r--c++-mode/ajf10
1 files changed, 10 insertions, 0 deletions
diff --git a/c++-mode/ajf b/c++-mode/ajf
new file mode 100644
index 0000000..5f206a9
--- /dev/null
+++ b/c++-mode/ajf
@@ -0,0 +1,10 @@
+# -*- mode: snippet -*-
+# name: adjacent_find
+# key: ajf
+# contributor: Tommy BENNETT and Ludwig PACIFICI <ludwig@lud.cc>
+# --
+auto pos = std::adjacent_find(std::begin(${1:container}), std::end($1));
+if (pos != std::end($1)) {
+ $2
+}
+$0