c++-mode: Use Name as the default placeholder for all snippet

The snippets previously used Class, MyClass, Name and Type. Now it's just Name
in all of them, based on the class11 snippet.
This commit is contained in:
Wieland Hoffmann 2018-10-03 10:33:21 +02:00
parent 1d1ea6f20c
commit 2ce06a1fa6
19 changed files with 19 additions and 19 deletions

View file

@ -2,7 +2,7 @@
# name: const_[] # name: const_[]
# key: c[ # key: c[
# -- # --
const ${1:Type}& operator[](${2:int index}) const const ${1:Name}& operator[](${2:int index}) const
{ {
$0 $0
} }

View file

@ -2,7 +2,7 @@
# name: constructor # name: constructor
# key: ct # key: ct
# -- # --
${1:Class}::$1(${2:args}) ${3: : ${4:init}} ${1:Name}::$1(${2:args}) ${3: : ${4:init}}
{ {
$0 $0
} }

View file

@ -2,4 +2,4 @@
# name: d+= # name: d+=
# key: d+= # key: d+=
# -- # --
${1:MyClass}& operator+=(${2:const $1 &}); ${1:Name}& operator+=(${2:const $1 &});

View file

@ -2,4 +2,4 @@
# name: d_operator<< # name: d_operator<<
# key: << # key: <<
# -- # --
friend std::ostream& operator<<(std::ostream&, const ${1:Class}&); friend std::ostream& operator<<(std::ostream&, const ${1:Name}&);

View file

@ -2,4 +2,4 @@
# name: d_operator[] # name: d_operator[]
# key: [ # key: [
# -- # --
${1:Type}& operator[](${2:int index}); ${1:Name}& operator[](${2:int index});

View file

@ -2,4 +2,4 @@
# name: d_operator[]_const # name: d_operator[]_const
# key: c[ # key: c[
# -- # --
const ${1:Type}& operator[](${2:int index}) const; const ${1:Name}& operator[](${2:int index}) const;

View file

@ -2,4 +2,4 @@
# name: d_operator>> # name: d_operator>>
# key: >> # key: >>
# -- # --
friend std::istream& operator>>(std::istream&, const ${1:Class}&); friend std::istream& operator>>(std::istream&, const ${1:Name}&);

View file

@ -2,4 +2,4 @@
# name: d_operator<< # name: d_operator<<
# key: << # key: <<
# -- # --
friend std::ostream& operator<<(std::ostream&, const ${1:Class}&); friend std::ostream& operator<<(std::ostream&, const ${1:Name}&);

View file

@ -2,4 +2,4 @@
# name: dynamic_casting # name: dynamic_casting
# key: cast # key: cast
# -- # --
check_and_cast<${1:Type} *>(${2:msg}); check_and_cast<${1:Name} *>(${2:msg});

View file

@ -2,7 +2,7 @@
# name: member_function # name: member_function
# key: mf # key: mf
# -- # --
${1:type} ${2:Class}::${3:name}(${4:args})${5: const} ${1:type} ${2:Name}::${3:name}(${4:args})${5: const}
{ {
$0 $0
} }

View file

@ -2,7 +2,7 @@
# name: module # name: module
# key: mod # key: mod
# -- # --
class ${1:Class} : public cSimpleModule class ${1:Name} : public cSimpleModule
{ {
$0 $0
} }

View file

@ -3,7 +3,7 @@
# key: != # key: !=
# group: operator overloading # group: operator overloading
# -- # --
bool ${1:MyClass}::operator!=(const $1 &other) const bool ${1:Name}::operator!=(const $1 &other) const
{ {
return !(*this == other); return !(*this == other);
} }

View file

@ -3,7 +3,7 @@
# key: + # key: +
# group: operator overloading # group: operator overloading
# -- # --
${1:MyClass} $1::operator+(const $1 &other) ${1:Name} $1::operator+(const $1 &other)
{ {
$1 result = *this; $1 result = *this;
result += other; result += other;

View file

@ -3,7 +3,7 @@
# key: += # key: +=
# group: operator overloading # group: operator overloading
# -- # --
${1:MyClass}& $1::operator+=(${2:const $1 &rhs}) ${1:Name}& $1::operator+=(${2:const $1 &rhs})
{ {
$0 $0
return *this; return *this;

View file

@ -4,7 +4,7 @@
# where this is a reference to myself # where this is a reference to myself
# group: operator overloading # group: operator overloading
# -- # --
${1:MyClass}& $1::operator=(const $1 &rhs) ${1:Name}& $1::operator=(const $1 &rhs)
{ {
// Check for self-assignment! // Check for self-assignment!
if (this == &rhs) if (this == &rhs)

View file

@ -3,7 +3,7 @@
# key: == # key: ==
# group: operator overloading # group: operator overloading
# -- # --
bool ${1:MyClass}::operator==(const $1 &other) const bool ${1:Name}::operator==(const $1 &other) const
{ {
$0 $0
} }

View file

@ -3,7 +3,7 @@
# key: [] # key: []
# group: operator overloading # group: operator overloading
# -- # --
${1:Type}& operator[](${2:int index}) ${1:Name}& operator[](${2:int index})
{ {
$0 $0
} }

View file

@ -3,7 +3,7 @@
# key: >> # key: >>
# group: operator overloading # group: operator overloading
# -- # --
std::istream& operator>>(std::istream& is, const ${1:Class}& ${2:c}) std::istream& operator>>(std::istream& is, const ${1:Name}& ${2:c})
{ {
$0 $0
return is; return is;

View file

@ -3,7 +3,7 @@
# key: << # key: <<
# group: operator overloading # group: operator overloading
# -- # --
std::ostream& operator<<(std::ostream& os, const ${1:Class}& ${2:c}) std::ostream& operator<<(std::ostream& os, const ${1:Name}& ${2:c})
{ {
$0 $0
return os; return os;