Skip to content

Commit 69560da

Browse files
Improve c++ for each statements and add mutable for each variant (talonhub#1982)
Co-authored-by: Nicholas Riley <[email protected]>
1 parent e028034 commit 69560da

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: forEachMutableStatement
2+
phrase: for each mute | each mute
3+
insertionScope: statement
4+
---
5+
6+
language: cpp
7+
-
8+
for (auto &$1 : $2) {
9+
$0
10+
}
11+
---
12+
13+
language: java
14+
-
15+
for ($1 : $2) {
16+
$0
17+
}
18+
---
19+
20+
language: javascript | typescript | javascriptreact | typescriptreact
21+
-
22+
for ($1 of $2) {
23+
$0
24+
}
25+
---

core/snippets/snippets/forEachStatement.snippet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: forEachStatement
2-
phrase: for each
2+
phrase: for each | each
33
insertionScope: statement
44
---
55

66
language: cpp
77
-
8-
for ($1 : $2) {
8+
for (const auto &$1 : $2) {
99
$0
1010
}
1111
---

0 commit comments

Comments
 (0)