Skip to content

Commit c39b093

Browse files
authored
Merge pull request #292 from mineo/c++-class-name
Use the same c++ class name placeholder in all c++-mode snippets
2 parents 0811650 + c9d08ca commit c39b093

20 files changed

+21
-21
lines changed

snippets/c++-mode/class

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class ${1:Name}
66
{
77
public:
8-
${1:$(yas/substr yas-text "[^: ]*")}();
9-
${2:virtual ~${1:$(yas/substr yas-text "[^: ]*")}();}
8+
${1:$(yas-c++-class-name yas-text)}();
9+
${2:virtual ~${1:$(yas-c++-class-name yas-text)}();}
1010
};
1111
$0

snippets/c++-mode/const_[]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# name: const_[]
33
# key: c[
44
# --
5-
const ${1:Type}& operator[](${2:int index}) const
5+
const ${1:Name}& operator[](${2:int index}) const
66
{
77
$0
88
}

snippets/c++-mode/constructor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# name: constructor
33
# key: ct
44
# --
5-
${1:Class}::$1(${2:args}) ${3: : ${4:init}}
5+
${1:Name}::$1(${2:args}) ${3: : ${4:init}}
66
{
77
$0
88
}

snippets/c++-mode/d+=

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# name: d+=
33
# key: d+=
44
# --
5-
${1:MyClass}& operator+=(${2:const $1 &});
5+
${1:Name}& operator+=(${2:const $1 &});

snippets/c++-mode/d_operator

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# name: d_operator<<
33
# key: <<
44
# --
5-
friend std::ostream& operator<<(std::ostream&, const ${1:Class}&);
5+
friend std::ostream& operator<<(std::ostream&, const ${1:Name}&);

snippets/c++-mode/d_operator[]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# name: d_operator[]
33
# key: [
44
# --
5-
${1:Type}& operator[](${2:int index});
5+
${1:Name}& operator[](${2:int index});

snippets/c++-mode/d_operator[]_const

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# name: d_operator[]_const
33
# key: c[
44
# --
5-
const ${1:Type}& operator[](${2:int index}) const;
5+
const ${1:Name}& operator[](${2:int index}) const;

snippets/c++-mode/d_operator_istream

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# name: d_operator>>
33
# key: >>
44
# --
5-
friend std::istream& operator>>(std::istream&, const ${1:Class}&);
5+
friend std::istream& operator>>(std::istream&, const ${1:Name}&);

snippets/c++-mode/d_operator_ostream

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# name: d_operator<<
33
# key: <<
44
# --
5-
friend std::ostream& operator<<(std::ostream&, const ${1:Class}&);
5+
friend std::ostream& operator<<(std::ostream&, const ${1:Name}&);

snippets/c++-mode/dynamic_casting

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# name: dynamic_casting
33
# key: cast
44
# --
5-
check_and_cast<${1:Type} *>(${2:msg});
5+
check_and_cast<${1:Name} *>(${2:msg});

0 commit comments

Comments
 (0)