Update.
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name : v.begin(), v.end()
|
||||
# key: beginend
|
||||
# --
|
||||
${1:v}.begin(), $1.end
|
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: const_[]
|
||||
# key: c[
|
||||
# --
|
||||
const ${1:Type}& operator[](${2:int index}) const
|
||||
{
|
||||
$0
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: constructor
|
||||
# key: ct
|
||||
# --
|
||||
${1:Class}::$1(${2:args}) ${3: : ${4:init}}
|
||||
{
|
||||
$0
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fori
|
||||
# key: fori
|
||||
# --
|
||||
for (${1:auto }${2:it} = ${3:var}.begin(); $2 != $3.end(); ++$2) {
|
||||
$0
|
||||
}
|
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: function
|
||||
# key: f
|
||||
# --
|
||||
${1:type} ${2:Class}::${3:name}(${4:args})${5: const}
|
||||
{
|
||||
$0
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator!=
|
||||
# key: !=
|
||||
# group: operator overloading
|
||||
# --
|
||||
bool ${1:MyClass}::operator!=(const $1 &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator+=
|
||||
# key: +=
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:MyClass}& $1::operator+=(${2:const $1 &rhs})
|
||||
{
|
||||
$0
|
||||
return *this;
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator+
|
||||
# key: +
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:MyClass} $1::operator+(const $1 &other)
|
||||
{
|
||||
$1 result = *this;
|
||||
result += other;
|
||||
return result;
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator==
|
||||
# key: ==
|
||||
# group: operator overloading
|
||||
# --
|
||||
bool ${1:MyClass}::operator==(const $1 &other) const
|
||||
{
|
||||
$0
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator=
|
||||
# key: =
|
||||
# where this is a reference to myself
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:MyClass}& $1::operator=(const $1 &rhs)
|
||||
{
|
||||
// Check for self-assignment!
|
||||
if (this == &rhs)
|
||||
return *this;
|
||||
$0
|
||||
return *this;
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator[]
|
||||
# key: []
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:Type}& operator[](${2:int index})
|
||||
{
|
||||
$0
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator>>
|
||||
# key: >>
|
||||
# group: operator overloading
|
||||
# --
|
||||
std::istream& operator>>(std::istream& is, const ${1:Class}& ${2:c})
|
||||
{
|
||||
$0
|
||||
return is;
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator<<
|
||||
# key: <<
|
||||
# group: operator overloading
|
||||
# --
|
||||
std::ostream& operator<<(std::ostream& os, const ${1:Class}& ${2:c})
|
||||
{
|
||||
$0
|
||||
return os;
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: tryw
|
||||
# key: tryw
|
||||
# --
|
||||
try {
|
||||
`(or yas/selected-text (car kill-ring))`
|
||||
} catch ${1:Exception} {
|
||||
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: try
|
||||
# key: try
|
||||
# a bit too intrusive now still, not always I want to do this
|
||||
# --
|
||||
try {
|
||||
$0
|
||||
} catch (${1:type}) {
|
||||
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
#name : do { ... } while (...)
|
||||
# key: do
|
||||
# --
|
||||
do
|
||||
{
|
||||
$0
|
||||
} while (${1:condition});
|
@@ -1,8 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# contributor: York Zhao
|
||||
# name: for_n
|
||||
# key: forn
|
||||
# --
|
||||
for (${1:auto }${2:i} = ${3:0}; $2 < ${4:MAXIMUM}; ++$2) {
|
||||
$0
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: main
|
||||
# key: main
|
||||
# --
|
||||
int main(${1:int argc, char *argv[]})
|
||||
{
|
||||
$0
|
||||
return 0;
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
#name : struct ... { ... }
|
||||
# key: struct
|
||||
# --
|
||||
struct ${1:name}
|
||||
{
|
||||
$0
|
||||
};
|
Reference in New Issue
Block a user