changes in c++ code
This commit is contained in:
parent
fba51c20d9
commit
d22b8960ca
6 changed files with 9 additions and 10 deletions
|
@ -3,7 +3,6 @@
|
|||
# key: fori
|
||||
# contributor: Andrea crotti
|
||||
# --
|
||||
|
||||
for (${1:iter}=${2:var}.begin(); $1!=$2.end(); ++$1) {
|
||||
$0
|
||||
}
|
|
@ -3,6 +3,4 @@
|
|||
# key: io
|
||||
# contributor: Andrea crotti
|
||||
# --
|
||||
|
||||
#include <iostream>
|
||||
$0
|
|
@ -3,10 +3,9 @@
|
|||
# key: +
|
||||
# contributor: Andrea crotti
|
||||
# --
|
||||
|
||||
${1://we need to have defined already the +=}
|
||||
const ${2:MyClass} $2::operator+(const $2 &other) const {
|
||||
$2 result = *this;
|
||||
${1:MyClass} $1::operator+(const $1 &other)
|
||||
{
|
||||
$1 result = *this;
|
||||
result += other;
|
||||
return result;
|
||||
}
|
|
@ -4,7 +4,8 @@
|
|||
# contributor: Andrea crotti
|
||||
# --
|
||||
|
||||
${1:MyClass} & $1::operator+=(const $1 &rhs) {
|
||||
${1:MyClass} & $1::operator+=(const $1 &rhs)
|
||||
{
|
||||
$0
|
||||
return *this;
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
# contributor: Andrea crotti
|
||||
# --
|
||||
|
||||
ostream& operator<<(ostream& s, const ${1:type}& ${2:c}) {
|
||||
ostream& operator<<(ostream& s, const ${1:type}& ${2:c})
|
||||
{
|
||||
$0
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
# contributor: Andrea crotti
|
||||
# --
|
||||
|
||||
istream& operator>>(istream& s, const ${1:type}& ${2:c}) {
|
||||
istream& operator>>(istream& s, const ${1:type}& ${2:c})
|
||||
{
|
||||
$0
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue