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:
parent
1d1ea6f20c
commit
2ce06a1fa6
19 changed files with 19 additions and 19 deletions
|
@ -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
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -2,4 +2,4 @@
|
|||
# name: d+=
|
||||
# key: d+=
|
||||
# --
|
||||
${1:MyClass}& operator+=(${2:const $1 &});
|
||||
${1:Name}& operator+=(${2:const $1 &});
|
|
@ -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}&);
|
|
@ -2,4 +2,4 @@
|
|||
# name: d_operator[]
|
||||
# key: [
|
||||
# --
|
||||
${1:Type}& operator[](${2:int index});
|
||||
${1:Name}& operator[](${2:int index});
|
|
@ -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;
|
|
@ -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}&);
|
|
@ -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}&);
|
|
@ -2,4 +2,4 @@
|
|||
# name: dynamic_casting
|
||||
# key: cast
|
||||
# --
|
||||
check_and_cast<${1:Type} *>(${2:msg});
|
||||
check_and_cast<${1:Name} *>(${2:msg});
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# name: module
|
||||
# key: mod
|
||||
# --
|
||||
class ${1:Class} : public cSimpleModule
|
||||
class ${1:Name} : public cSimpleModule
|
||||
{
|
||||
$0
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
# key: []
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:Type}& operator[](${2:int index})
|
||||
${1:Name}& operator[](${2:int index})
|
||||
{
|
||||
$0
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue