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_[]
# key: c[
# --
const ${1:Type}& operator[](${2:int index}) const
const ${1:Name}& operator[](${2:int index}) const
{
$0
}

View file

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

View file

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

View file

@ -2,4 +2,4 @@
# name: d_operator<<
# 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[]
# key: [
# --
${1:Type}& operator[](${2:int index});
${1:Name}& operator[](${2:int index});

View file

@ -2,4 +2,4 @@
# name: d_operator[]_const
# 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>>
# 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<<
# 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
# 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
# key: mf
# --
${1:type} ${2:Class}::${3:name}(${4:args})${5: const}
${1:type} ${2:Name}::${3:name}(${4:args})${5: const}
{
$0
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
# key: >>
# 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
return is;

View file

@ -3,7 +3,7 @@
# key: <<
# 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
return os;